Merge pull request #1202 from internetee/improve-registrar-area-account-view

Improve registrar area account view
This commit is contained in:
Timo Võhmar 2019-06-07 13:48:48 +03:00 committed by GitHub
commit 7b7a87348b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 137 additions and 56 deletions

View file

@ -0,0 +1,22 @@
require 'test_helper'
class RegistrarAccountTest < ApplicationSystemTestCase
setup do
@registrar = registrars(:bestnames)
sign_in users(:api_bestnames)
end
def test_updates_account
new_billing_email = 'new@registrar.test'
assert_not_equal new_billing_email, @registrar.billing_email
visit registrar_account_path
click_on 'Edit'
fill_in 'Billing email', with: new_billing_email
click_on 'Save changes'
assert_text 'Your account has been updated'
assert_text new_billing_email
end
end

View file

@ -17,10 +17,10 @@ class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
assert_current_path registrar_root_path
end
def test_after_successful_sign_in_billing_user_sees_profile
def test_after_successful_sign_in_billing_user_sees_account
@user.update!(roles: [ApiUser::BILLING])
login_with_correct_credentials
assert_current_path registrar_profile_path
assert_current_path registrar_account_path
end
def test_wrong_password