Testing Rail's route's :constraints lambda with RSpec 2 -
question : how setup/mock rspec routing test more production rack environment? bonus points being able call controller's authentication function first (eg applicationcontroller.authenticate_user set session[:current_user_id] details : i using route :constraints have www.example.com/ route 2 different controllers & views depending on if user logged in or not. root :to => 'intentions#latest', :constraints => lambda {|r| r.env['rack.session'].has_key?(:current_user_id) } root :to => 'welcome#index' i wanted make sure bit of fragile routing has proper test around it. cukes testing wanted bit deeper of testing, messed :current_user_id , cukes did not catch that. example fat fingered :current_user_id in applicationcontroller's authenticate_user() method. love call in before(:each) , make sure setting correct session key. so created file called /spec/routing/auth_routing_spec.rb , tried follow guide @ http://relishapp.com/rspec/rs...