mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
parent
c1875ec88e
commit
787cca8e4c
9 changed files with 134 additions and 46 deletions
16
spec/features/registrar/current_user/switch_spec.rb
Normal file
16
spec/features/registrar/current_user/switch_spec.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Registrar area current user switch', settings: false do
|
||||
given!(:current_user) { create(:api_user, id: 1, identity_code: 'test') }
|
||||
given!(:new_user) { create(:api_user, id: 2, identity_code: 'test', username: 'new-user-name') }
|
||||
|
||||
background do
|
||||
sign_in_to_registrar_area(user: current_user)
|
||||
end
|
||||
|
||||
it 'switches current user' do
|
||||
visit registrar_root_path
|
||||
click_link_or_button 'switch-current-user-2-btn'
|
||||
expect(page).to have_text('You are now signed in as a user "new-user-name"')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue