mirror of
https://github.com/internetee/registry.git
synced 2025-08-20 16:34:00 +02:00
Integrate master branch
This commit is contained in:
parent
bf3b54367b
commit
6de31605d9
8 changed files with 9 additions and 9 deletions
|
@ -1,44 +0,0 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaLoginTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
@user = users(:admin)
|
||||
end
|
||||
|
||||
def test_correct_username_and_password
|
||||
visit new_admin_user_session_url
|
||||
fill_in 'admin_user_username', with: @user.username
|
||||
fill_in 'admin_user_password', with: 'testtest'
|
||||
click_button 'Sign in'
|
||||
|
||||
assert_text 'Signed in successfully'
|
||||
assert_current_path admin_root_path
|
||||
end
|
||||
|
||||
def test_wrong_password
|
||||
visit new_admin_user_session_url
|
||||
fill_in 'admin_user_username', with: @user.username
|
||||
fill_in 'admin_user_password', with: 'wrong'
|
||||
click_button 'Sign in'
|
||||
|
||||
assert_text 'Invalid Username or password'
|
||||
assert_current_path new_admin_user_session_path
|
||||
end
|
||||
|
||||
def test_retry_with_correct_username_and_password
|
||||
visit new_admin_user_session_url
|
||||
fill_in 'admin_user_username', with: @user.username
|
||||
fill_in 'admin_user_password', with: 'wrong'
|
||||
click_button 'Sign in'
|
||||
|
||||
assert_text 'Invalid Username or password'
|
||||
assert_current_path new_admin_user_session_path
|
||||
|
||||
fill_in 'admin_user_username', with: @user.username
|
||||
fill_in 'admin_user_password', with: 'testtest'
|
||||
click_button 'Sign in'
|
||||
|
||||
assert_text 'Signed in successfully'
|
||||
assert_current_path admin_root_path
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue