Monday, 24 June 2013

Static pages should have the right links on the layout

While practising Michael Hartl's Rails tutorial, when I want to test the links. One test is failing with the following error message.
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 :

No comments:

Post a Comment