title: Rails test/unit testing helper method, NoMethodError: undefined method
body: <p>How to avoid this error:</p>
  
  <pre><code>Error: test_update_location(LocationControllerTest)
  NoMethodError: undefined method `show_previous_version' for test_update_location(LocationControllerTest):LocationControllerTest/usr/local/rvm/gems/ruby-1.9.3-p327/gems/actionpack-2.1.1/lib/action_controller/test_process.rb:467:in `method_missing'
  </code></pre>
  
  <p>I want to test the helper method <code>show_previous_version</code> defined in <code>app/helpers/description_helper.rb</code>:</p>
  
  <pre><code>def show_previous_version(obj)
      ...
    return html
  end
  </code></pre>
  
  <p>In <code>app/helpers/application _helper.rb</code>:</p>
  
  <pre><code>module ApplicationHelper
    .....
    require_dependency 'description_helper'
    ...
  end
  </code></pre>
  
  <p>In <code>test/functional/location_controller_test.rb</code></p>
  
  <pre><code>def test_update_location
    ...
    loc = Location.find(loc.id)
    html = show_previous_version(loc)
    ...
  end
  </code></pre>
  
  <p>When I run the tests, I get:</p>
  
  <pre><code>Error: test_update_location(LocationControllerTest)
  NoMethodError: undefined method `show_previous_version' for test_update_location(LocationControllerTest):LocationControllerTest/usr/local/rvm/gems/ruby-1.9.3-p327/gems/actionpack-2.1.1/lib/action_controller/test_process.rb:467:in `method_missing'
  </code></pre>