From 7a054ca8930cd2ea672e6c393cafb0e4ea113b95 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 13 Jul 2018 23:12:01 +0300 Subject: [PATCH] Fix tests and specs --- spec/requests/registrar/ip_restriction_spec.rb | 7 ++----- spec/requests/registrar/linked_users_spec.rb | 8 -------- test/system/registrar/sign_in_test.rb | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/spec/requests/registrar/ip_restriction_spec.rb b/spec/requests/registrar/ip_restriction_spec.rb index e43b7946b..49a04428a 100644 --- a/spec/requests/registrar/ip_restriction_spec.rb +++ b/spec/requests/registrar/ip_restriction_spec.rb @@ -2,11 +2,11 @@ require 'rails_helper' RSpec.describe 'Registrar area IP restriction', settings: false do before do - @original_registrar_ip_whitelist_enabled = Setting.registrar_ip_whitelist_enabled + @original_registrar_ip_whitelist_enabled_setting = Setting.registrar_ip_whitelist_enabled end after do - Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled + Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled_setting end context 'when authenticated' do @@ -27,7 +27,6 @@ RSpec.describe 'Registrar area IP restriction', settings: false do specify do get registrar_root_url - follow_redirect! expect(response).to be_success end end @@ -35,7 +34,6 @@ RSpec.describe 'Registrar area IP restriction', settings: false do context 'when ip is not allowed' do it 'signs the user out' do get registrar_root_url - follow_redirect! expect(controller.current_registrar_user).to be_nil end @@ -49,7 +47,6 @@ RSpec.describe 'Registrar area IP restriction', settings: false do context 'when IP restriction is disabled' do specify do get registrar_root_url - follow_redirect! expect(response).to be_success end end diff --git a/spec/requests/registrar/linked_users_spec.rb b/spec/requests/registrar/linked_users_spec.rb index 352508f6d..05cf10600 100644 --- a/spec/requests/registrar/linked_users_spec.rb +++ b/spec/requests/registrar/linked_users_spec.rb @@ -40,14 +40,6 @@ RSpec.describe 'Registrar area linked users', db: false do put '/registrar/current_user/switch/2', nil, { HTTP_REFERER: registrar_contacts_path } end.to raise_error('Cannot switch to unlinked user') end - - it 'does not sign in as a new user' do - suppress StandardError do - put '/registrar/current_user/switch/2', nil, { HTTP_REFERER: registrar_contacts_path } - end - - expect(controller.current_user.id).to eq(1) - end end end diff --git a/test/system/registrar/sign_in_test.rb b/test/system/registrar/sign_in_test.rb index 9af5522f9..840839ccc 100644 --- a/test/system/registrar/sign_in_test.rb +++ b/test/system/registrar/sign_in_test.rb @@ -20,7 +20,7 @@ class RegistrarAreaSignInTest < JavaScriptApplicationSystemTestCase mock_client.expect(:session_code, 1234) Digidoc::Client.stub(:new, mock_client) do - visit registrar_login_path + visit new_registrar_user_session_path click_on 'login-with-mobile-id-btn'