Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegration Testing With Ruby on Rails Tutorial Issue
    text
    copied!<p>I'm trying to follow the ruby on rails tutorial and impliment the Integration Testing.</p> <p>I first run the command: <code>bundle exec rspec spec/</code></p> <p>And it tells me all but one of my sixteen tests passes. Here is the part where I think the issue is:</p> <pre><code> require 'spec_helper' describe "LayoutLinks" do it "should have the right links on the layout" do visit root_path click_link "Help" response.should have_selector('title', :content =&gt; "Help") click_link "Contact" response.should have_selector('title', :content =&gt; "Contact") click_link "Home" response.should have_selector('title', :content =&gt; "Home") click_link "Sign up now!" response.should have_selector('title', :content =&gt; "Sign Up") click_link "About" response.should have_selector('title', :content =&gt; "About") end end </code></pre> <p>As a result I get the following:</p> <pre><code>Failure/Error: response.should have_selector('title', :content =&gt; "Help") expected following output to contain a &lt;title&gt;Help&lt;/title&gt; tag: #home.html.erb page's source shown &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"&gt; &lt;title&gt;Ruby on Rails Tutorial Sample App | Home&lt;/title&gt; #The line above is why the test fails. #It is loading home.html.erb instead of help.html.erb . . . # ./spec/requests/layout_links_spec.rb:34:in `block (2 levels) in &lt;top (required)&gt;' </code></pre> <p>I can move around the order of the tests and it is always the top test that fails. This makes me believe there is something wrong here and not with the actual rails code. I can also go to the demo website and the links work and they go to the correct pages. I have looked at the other issues other people have had with this and I can't seem to find anyone who is having the same issues. How can I go about trouble shooting this?</p> <p>Update: </p> <pre><code>noahc:sample_app noahc$ rake routes users_new GET /users/new(.:format) {:controller=&gt;"users", :action=&gt;"new"} signup /signup(.:format) {:controller=&gt;"users", :action=&gt;"new"} contact /contact(.:format) {:controller=&gt;"pages", :action=&gt;"contact"} about /about(.:format) {:controller=&gt;"pages", :action=&gt;"about"} help /help(.:format) {:controller=&gt;"pages", :action=&gt;"help"} /help(.:format) {:controller=&gt;"pages", :action=&gt;"help"} root / {:controller=&gt;"pages", :action=&gt;"home"} pages_home GET /pages/home(.:format) {:controller=&gt;"pages", :action=&gt;"home"} pages_contact GET /pages/contact(.:format) {:controller=&gt;"pages", :action=&gt;"contact"} pages_about GET /pages/about(.:format) {:controller=&gt;"pages", :action=&gt;"about"} pages_help GET /pages/help(.:format) {:controller=&gt;"pages", :action=&gt;"help"} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload