mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Fix tests and specs
This commit is contained in:
parent
32ecf36057
commit
7a054ca893
3 changed files with 3 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue