Jack Christensen
2010-Nov-01 20:50 UTC
Rails 3 functional tests with HTTPS routes work alone but fail with rake
I have routes that are constrained to the https prototcol. scope :constraints => { :protocol => "https" } do resource :user_session end I have my functional tests set to use https. require ''test_helper'' class UserSessionsControllerTest< ActionController::TestCase def setup request.env[''HTTPS''] = ''on'' end test "new" do get :new assert_response :success end end When I run this functional test by itself it works. When I run all tests via rake it fails with: test_new(UserSessionsControllerTest): ActionController::RoutingError: No route matches {:controller=>"user_sessions", :action=>"new"} actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:424:in `raise_routing_error'' actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:406:in `generate'' actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:453:in `generate'' actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:449:in `generate_extras'' actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:445:in `extra_keys'' actionpack (3.0.1) lib/action_controller/test_case.rb:136:in `assign_parameters'' actionpack (3.0.1) lib/action_controller/test_case.rb:395:in `process'' actionpack (3.0.1) lib/action_controller/test_case.rb:343:in `get'' /test/functional/user_sessions_controller_test.rb:14:in `test_new'' activesupport (3.0.1) lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'' activesupport (3.0.1) lib/active_support/testing/setup_and_teardown.rb:67:in `run'' activesupport (3.0.1) lib/active_support/callbacks.rb:443:in `_run_setup_callbacks'' activesupport (3.0.1) lib/active_support/testing/setup_and_teardown.rb:65:in `run'' Any ideas? Thanks. -- Jack Christensen jackc-/SOt/BrQZzMOf2zXYvRtkodd74u8MsAO@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.