diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-07-18 15:33:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-07-18 17:43:11 +0100 |
commit | 9fe48c5b9db1c0ba6c1a59f0d092c88e5cae1aa0 (patch) | |
tree | 6a244ebe1422fa9fe627a7b4eebf2055adc6016e /spec/controllers/user_controller_spec.rb | |
parent | 6d67f4df65f8b56c9d54d71d449d46b1c6c92be2 (diff) |
Switch routing-filter (which takes locale out of the params and puts it in the URL) off by default in model, controller, and helper tests. This means we can supply the locale as a param. Turn it on specifically for a couple of controller tests that test routing, and change other url localization tests into integration tests.
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index b09594b9c..fe95aa31c 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -105,8 +105,6 @@ describe UserController, "when signing in" do end it "should log in when you give right email/password, and redirect to where you were" do - RoutingFilter.active = false - get :signin, :r => "/list" response.should render_template('sign') post_redirect = get_last_postredirect @@ -117,13 +115,9 @@ describe UserController, "when signing in" do # response doesn't contain /en/ but redirect_to does... response.should redirect_to(:controller => 'request', :action => 'list', :post_redirect => 1) ActionMailer::Base.deliveries.should be_empty - - RoutingFilter.active = true end it "should not log you in if you use an invalid PostRedirect token, and shouldn't give 500 error either" do - RoutingFilter.active = false - post_redirect = "something invalid" lambda { post :signin, { :user_signin => { :email => 'bob@localhost', :password => 'jonespassword' }, @@ -134,8 +128,6 @@ describe UserController, "when signing in" do :token => post_redirect } response.should render_template('sign') assigns[:post_redirect].should == nil - - RoutingFilter.active = true end # No idea how to test this in the test framework :( @@ -159,8 +151,6 @@ describe UserController, "when signing in" do end it "should confirm your email, log you in and redirect you to where you were after you click an email link" do - RoutingFilter.active = false - get :signin, :r => "/list" post_redirect = get_last_postredirect @@ -186,13 +176,9 @@ describe UserController, "when signing in" do get :confirm, :email_token => post_redirect.email_token session[:user_id].should == users(:unconfirmed_user).id response.should redirect_to(:controller => 'request', :action => 'list', :post_redirect => 1) - - RoutingFilter.active = true end it "should keep you logged in if you click a confirmation link and are already logged in as an admin" do - RoutingFilter.active = false - get :signin, :r => "/list" post_redirect = get_last_postredirect @@ -223,7 +209,6 @@ describe UserController, "when signing in" do # And the redirect should still work, of course response.should redirect_to(:controller => 'request', :action => 'list', :post_redirect => 1) - RoutingFilter.active = true end end @@ -301,14 +286,10 @@ describe UserController, "when signing out" do end it "should log you out and redirect you to where you were" do - RoutingFilter.active = false - session[:user_id] = users(:bob_smith_user).id get :signout, :r => '/list' session[:user_id].should be_nil response.should redirect_to(:controller => 'request', :action => 'list') - - RoutingFilter.active = true end end |