mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
SIM error test
This commit is contained in:
parent
53bf7e209d
commit
5d08164f10
2 changed files with 30 additions and 3 deletions
|
@ -18,7 +18,7 @@
|
|||
$.post('/registrar/login/mid_status').fail((data) ->
|
||||
clearInterval(status_interval)
|
||||
flash_alert(data.responseJSON.message)
|
||||
('.js-login').attr('disabled', false)
|
||||
$('.js-login').attr('disabled', false)
|
||||
)
|
||||
), 1000)
|
||||
|
||||
|
|
|
@ -50,9 +50,36 @@ feature 'Sessions', type: :feature do
|
|||
end
|
||||
|
||||
scenario 'Api user should when there is a sim error', js: true do
|
||||
client = instance_double("Digidoc::Client",
|
||||
session_code: '123'
|
||||
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: 'SIM_ERROR')
|
||||
)
|
||||
|
||||
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('SIM application error')
|
||||
end
|
||||
|
||||
scenario 'Api user should log in', js: true do
|
||||
client = instance_double("Digidoc::Client", session_code: '123')
|
||||
|
||||
allow(client).to receive('session_code=')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue