title: Making functional tests in Rails with Devise
body: <p>After 3 years of procrastination today is the day that I start testing my Rails apps. My first step is to fix the failing tests in my Rails 3 beta4 app.</p>
  
  <p>My last 3 failing tests have to do with the devise gem and its authenticate_user! method in a before_filter at the top of my controller.</p>
  
  <p>You'd earn great karma by helping me out with this since it will enable me to use the TDD methodology from now on.</p>
  
  <p>Here is the error that troubles me:</p>
  
  <pre><code>1) Error:
  test_should_get_accepted(ModerationControllerTest):
  NoMethodError: undefined method `authenticate!' for nil:NilClass
      /test/functional/moderation_controller_test.rb:10:in `test_should_get_accepted'
  </code></pre>
  
  <p>Devise just gives functional tests pointers and helpers in this page: <a href="http://github.com/plataformatec/devise" rel="noreferrer">http://github.com/plataformatec/devise</a> but I just don't know how to put this into application.</p>
  
  <p>Can you please give this testing noob some detailed instructions on how to use these helpers?</p>