Fix tests and specs

This commit is contained in:
Artur Beljajev 2018-07-13 23:12:01 +03:00
parent 32ecf36057
commit 7a054ca893
3 changed files with 3 additions and 14 deletions

View file

@ -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

View file

@ -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

View file

@ -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'