title: Rspec Rails - Mock to be current_user to test the controller
body: <p>i've started writing tests for my controllers. For once of them, i need to be logged in, in order to check whether the page is rendered etc.</p>
  
  <p>Since i'm using Devise that has a current_user helper over a User model, how can i form my :</p>
  
  <pre><code>describe "when it GETS 'town'" do
    it "should render the template and be successful" do
      get :index
      response.should render_template(:index)
      response.should be_success
    end
  end
  </code></pre>
  
  <p>so that i don't get the undefined "authenticate!" method (devise specific) error ?</p>