Error: "Static pages should have the right links on the layout"
This can be fixed by putting "visit root_path" before click_link "Sign up now!"screen shot of the code is given below.
___________________
it "should have the right links on the layout" do____________________
visit root_path
click_link "About"
page.should have_selector 'title', text: full_title('About Us')
click_link "Help"
page.should # fill in
click_link "Contact"
page.should # fill in
click_link "Home"
visit root_path
click_link "Sign up now!"
page.should # fill in
click_link "sample app"
page.should # fill in
end
Useful Links :
- http://stackoverflow.com/questions/5361916/my-rspec-test-wont-pass-michael-hartls-rails-tutorial
- http://stackoverflow.com/questions/11732971/rails-link-to-not-found-by-capybara
- http://stackoverflow.com/questions/6701223/rail3-tutorial-testingchapter-5-click-link-error
- http://stackoverflow.com/questions/12242045/expected-css-title-hartls-tutorial-chapter-5-exercises
No comments:
Post a Comment