internetee-registry/test/system/registrar_area/sign_in/password_test.rb
2018-08-09 13:43:11 +03:00

39 lines
No EOL
1.1 KiB
Ruby

require 'test_helper'
class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
def setup
@user = users(:api_bestnames)
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'
assert_text 'Log out'
assert_current_path registrar_poll_path
end
def test_wrong_password
visit new_registrar_user_session_url
fill_in 'registrar_user_username', with: @user.username
fill_in 'registrar_user_password', with: 'wrong'
click_button 'Login'
assert_text 'No such user'
assert_current_path new_registrar_user_session_path
end
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'
assert_text 'User is not active'
assert_current_path new_registrar_user_session_path
end
end