Fix home page link

This commit is contained in:
Artur Beljajev 2018-08-22 00:21:12 +03:00
parent a2a67159d4
commit 211f8c9143
10 changed files with 31 additions and 30 deletions

View file

@ -20,6 +20,6 @@ class RegistrarAreaProtectedAreaTest < ApplicationSystemTestCase
visit new_registrar_user_session_url
assert_text 'You are already signed in'
assert_current_path registrar_poll_path
assert_current_path registrar_root_path
end
end

View file

@ -6,13 +6,21 @@ class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
end
def test_correct_username_and_password
visit new_registrar_user_session_url
fill_in 'registrar_user_username', with: @user.username
fill_in 'registrar_user_password', with: 'testtest'
click_button 'Login'
login_with_correct_credentials
assert_text 'Log out'
assert_current_path registrar_poll_path
assert_current_path registrar_root_path
end
def test_after_successful_sign_in_super_user_sees_service_message_list
@user.update!(roles: [ApiUser::SUPER])
login_with_correct_credentials
assert_current_path registrar_root_path
end
def test_after_successful_sign_in_billing_user_sees_profile
@user.update!(roles: [ApiUser::BILLING])
login_with_correct_credentials
assert_current_path registrar_profile_path
end
def test_wrong_password
@ -27,13 +35,18 @@ class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
def test_inactive_user
@user.update!(active: false)
visit new_registrar_user_session_url
fill_in 'registrar_user_username', with: @user.username
fill_in 'registrar_user_password', with: 'testtest'
click_button 'Login'
login_with_correct_credentials
assert_text 'User is not active'
assert_current_path new_registrar_user_session_path
end
private
def login_with_correct_credentials
visit new_registrar_user_session_url
fill_in 'registrar_user_username', with: @user.username
fill_in 'registrar_user_password', with: 'testtest'
click_button 'Login'
end
end