From e5d2b4911968dd0f1908a685520feb14acbdec90 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 5 Jun 2015 18:58:20 +1000 Subject: [PATCH] correct specs --- spec/controllers/users_controller_spec.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 5388bb1f083..cf657684eaf 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -321,22 +321,9 @@ describe UsersController do context 'enqueues mail' do it 'enqueues mail with admin email and sso enabled' do - SiteSetting.enable_sso = true Jobs.expects(:enqueue).with(:user_email, has_entries(type: :admin_login, user_id: admin.id)) put :admin_login, email: admin.email end - - it 'does not enqueue mail with admin email and sso disabled' do - SiteSetting.enable_sso = false - Jobs.expects(:enqueue).never - put :admin_login, email: admin.email - end - - it 'does not enqueue mail with normal user email and sso enabled' do - SiteSetting.enable_sso = true - Jobs.expects(:enqueue).never - put :admin_login, email: user.email - end end context 'logs in admin' do @@ -346,13 +333,13 @@ describe UsersController do expect(session[:current_user_id]).to be_blank end - it 'does not log in admin with valid token and SSO disabled' do + it 'does log in admin with valid token and SSO disabled' do SiteSetting.enable_sso = false token = admin.email_tokens.create(email: admin.email).token get :admin_login, token: token expect(response).to redirect_to('/') - expect(session[:current_user_id]).to be_blank + expect(session[:current_user_id]).to eq(admin.id) end it 'logs in admin with valid token and SSO enabled' do