mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
parent
26eb47ae09
commit
6e597f39e8
9 changed files with 178 additions and 124 deletions
21
spec/features/registrar/sign_in/mobile_id_spec.rb
Normal file
21
spec/features/registrar/sign_in/mobile_id_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.feature 'Mobile ID login', db: true do
|
||||
given!(:api_user) { Fabricate(:api_user, identity_code: 1234) }
|
||||
|
||||
background do
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
digidoc_client = instance_double(Digidoc::Client, authenticate: OpenStruct.new(user_id_code: 1234), session_code: 1234)
|
||||
allow(Digidoc::Client).to receive(:new).and_return(digidoc_client)
|
||||
end
|
||||
|
||||
scenario 'login with phone number' do
|
||||
visit registrar_login_path
|
||||
click_on 'login-with-mobile-id-btn'
|
||||
|
||||
fill_in 'user[phone]', with: '1234'
|
||||
click_button 'Login'
|
||||
|
||||
expect(page).to have_text('Confirmation sms was sent to your phone. Verification code is')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue