title: How do I rspec with valid_session using Facebooker2 in rails 3?
body: <p>I'm pretty new to Rails. I have been developing my app with RSpec. I have just followed a <a href="http://www.engineyard.com/video/21045039" rel="nofollow">tutorial</a> for Facebooker2 and added the <code>before_filter</code> for authentication.</p>
  
  <pre><code>#app/controller/application_controller.rb
  before_filter :ensure_authenticated
  </code></pre>
  
  <p>However, my specs such as the one below failed because there's no valid session which is understandable.</p>
  
  <pre><code>#spec/controllers/answers_controller_spec.rb
  describe "GET index" do
    it "assigns all answers as @answers" do
      get :index, {}, valid_session
      assigns(:answers).should include(answers(:reading))
    end
  end
  </code></pre>
  
  <p>But I can't seem to find a way to fake a valid session for rspec to use in the following function. </p>
  
  <pre><code>#spec/controllers/answers_controller_spec.rb
  def valid_session
    {}
  end
  </code></pre>
  
  <p>Is there a way at all? If not, what is the rails way of doing things for such a case?</p>