I am new to Rails. I am developing my application with RSpec. I just completed a tutorial for Facebooker2 and added before_filter for authentication.
However, my specifications, such as the ones below, failed because there is no valid session that is clear.
#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
But I cannot find a way to fake a valid session for rspec for use in the following function.
Is there any way? If not, what is the rails way of doing things for such a case?
mmhan source share