I'm following along through the tutorial and my site links work, but the only site_layout link test that doesn't pass is /about path. I checked over my routes file, footer file and site_layout_test and can't seem to find whats wrong
1) Failure:
SiteLayoutTest#test_layout_links [/home/ubuntu/workspace/sample_app/test/integration/site_layout_test.rb:10]:
Expected at least 1 element matching "a[href="/about"]", found 0..
Expected 0 to be >= 1.
Rails.application.routes.draw do
root 'static_pages#home'
get 'help' => 'static_pages#help'
get 'about' => 'static_pages#about'
get 'contact' => 'static_pages#contact'
<footer class="footer">
<small>
The <a href= "http://www.railstutorial.org/">Ruby on Rails Tutorial</a>
by <a href="http://www.michaelhartl.com/">Michael Hartl</a>
</small>
<nav>
<ul>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact", contact_path %></li>
<li><a href="http://news.railstutorial.org/">News</a></li>
</ul>
</nav>
</footer>
require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path, count: 2
assert_select "a[href=?]", help_path
assert_select "a[href=?]", about_path
assert_select "a[href=?]", contact_path
end
This seems to be a bug that common bug with the cloud 9 ide. I double checked every view file and my integration tests find 3 links to root_path when there are only 2. If you run the tests on your a local app inside your local rails console, they work. c9's console is not correct.