Hi Everyone,
I’ve been working with cucumber trying to tests links using the scenario
outline feature of cucumber. What I want to do is have it visit the
starting_page and then click on the specified link. It should then check
to
make sure the title is correct on that page to ensure it’s on the
expected
page. Spent quite a bit of time googling without any luck.
Error I’ve been receiving:
expected css “title” to return something
(RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/managing_pages_steps.rb:11:in/^I should be able to change pages by clicking "([^"]*)" and the title is "([^"]*)"$/' features/managing_pages.feature:12:in
Then I should be able to
change pages by clicking “” and the title is “”’
My code is below:
*
managing_pages.feature*
- managing_pages_steps.rb
Given /^I am an anonymous user$/ do
response.should have_selector(‘title’, :content => “Contact”)
end
application_helper.rb
end
end
pages_controller.rb
*
class PagesController < ApplicationController
def home
@title = “Home”
enddef contact
@title = “Contact”
end
end
*layouts/application.html.erb
<%= yield %>
Any help is much appreciated!