mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
MID login success test
This commit is contained in:
parent
61da96d18a
commit
53bf7e209d
1 changed files with 31 additions and 0 deletions
|
@ -48,4 +48,35 @@ feature 'Sessions', type: :feature do
|
|||
click_button 'Log in'
|
||||
page.should have_text('No such user')
|
||||
end
|
||||
|
||||
scenario 'Api user should when there is a sim error', js: true do
|
||||
client = instance_double("Digidoc::Client",
|
||||
session_code: '123'
|
||||
)
|
||||
|
||||
allow(client).to receive('session_code=')
|
||||
|
||||
allow(client).to receive(:authenticate).and_return(
|
||||
OpenStruct.new(
|
||||
user_id_code: '14212128025'
|
||||
)
|
||||
)
|
||||
|
||||
allow(client).to receive('authentication_status').and_return(
|
||||
OpenStruct.new(status: 'USER_AUTHENTICATED')
|
||||
)
|
||||
|
||||
allow(Digidoc::Client).to receive(:new) { client }
|
||||
|
||||
visit registrar_login_path
|
||||
page.should have_css('a[href="/registrar/login/mid"]')
|
||||
|
||||
page.find('a[href="/registrar/login/mid"]').click
|
||||
|
||||
fill_in 'user_phone', with: '00007'
|
||||
click_button 'Log in'
|
||||
|
||||
page.should have_text('Check your phone for confirmation code')
|
||||
page.should have_text('Welcome!')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue