title: On Chapter 8 of Michael Hartl's Rails Tutorial, Listing 8.25 test suite RED
body: <p>I'm new on StackOverflow as I've recently begun to learn Ruby on Rails with Michael Hartl's Tutorial. I can't seem to pass the test of listing 8.25 ("At this point, the test suite should still be GREEN:" $ bundle exec rake test):</p>
  
  <p>My test is RED and the error is as follows:</p>
  
  <pre><code>~/workspace/sample_app (log-in-log-out) $ bundle exec rake test
  Started
  
  ERROR["test_layout_links", SiteLayoutTest, 2016-04-14 23:15:47 +0000]
   test_layout_links#SiteLayoutTest (1460675747.92s)
  NoMethodError:         NoMethodError: undefined method `full_title' for #    &lt;SiteLayoutTest:0x0000000a30bad8&gt;
              test/integration/site_layout_test.rb:13:in `block in     &lt;class:SiteLayoutTest&gt;'
      test/integration/site_layout_test.rb:13:in `block in &lt;class:SiteLayoutTest&gt;'
  
    22/22: [======================================================] 100% Time:     00:00:01, Time: 00:00:01
  
  Finished in 1.30261s
   tests, 49 assertions, 0 failures, 1 errors, 0 skips
  </code></pre>
  
  <p>I've gone through all the recent changes in chapter 7 and 8 again; the tests of 8.20, 8.21 and 8.24 just pass.</p>
  
  <p>The file site_layout_test mentioned in the error looks like this:</p>
  
  <pre><code>require 'test_helper'
  
  class SiteLayoutTest &lt; 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
    get signup_path
    assert_select "title", full_title("Sign up")
    end
  end
  </code></pre>
  
  <p>ADDITIONS:</p>
  
  <p>1) This is the tutorial I'm doing: <a href="https://www.railstutorial.org/book/log_in_log_out" rel="nofollow">https://www.railstutorial.org/book/log_in_log_out</a></p>
  
  <p>2) This is the file that the error refers to:</p>
  
  <pre><code>require 'test_helper'
  
  class SiteLayoutTest &lt; 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
    get signup_path
    assert_select "title", full_title("Sign up")
    end
  end
  </code></pre>
  
  <p>If I take the last assert_select out, I don't get the error anymore.</p>
  
  <p>And this is the application_helper:</p>
  
  <pre><code>module ApplicationHelper
    # Returns the full title on a per-page basis.
    def full_title(page_title = '')
      base_title = "Ruby on Rails Tutorial Sample App"
      if page_title.empty?
        base_title
      else
        page_title + " | " + base_title
      end
    end
  end
  </code></pre>
  
  <p>Your help is much appreciated. Thanks in advance!</p>