KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have: When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| with_scope(selector) do click_link(link) end end Which I call from: Background: Given I am an existing admin user When I follow "CLIENTS" my HTML is like this: <a class="active" href="/companies"><h2>CLIENTS</h2></a> and I keep getting this error: .F-.F--U-----U (::) failed steps (::) no link with title, id or text 'CLIENTS' found (Capybara::ElementNotFound) (eval):2:in `click_link' ./features/step_definitions/web_steps.rb:54:in `block (2 levels) in <top (required)>' ./features/step_definitions/web_steps.rb:14:in `with_scope' ./features/step_definitions/web_steps.rb:53:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/' features/client_add.feature:8:in `When I follow "CLIENTS"' I tried a few things from: When I follow "<h2>CLIENTS</h2>" and even tried the save_and_open_page which should open the browser and still get the same results: Given /^I am an existing admin user$/ do role_user = FactoryGirl.create(:role_user) admin_user = role_user.user sign_in(admin_user) save_and_open_page end Is there a way to print the HTML or some way to figure out why my test is failing?
Tags (comma-separated)
Save Edits
Cancel