mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Add tests
This commit is contained in:
parent
84bf967780
commit
02aad0d781
1 changed files with 25 additions and 0 deletions
25
test/integration/admin/api_user/new_test.rb
Normal file
25
test/integration/admin/api_user/new_test.rb
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class AdminAreaNewApiUserTest < ActionDispatch::IntegrationTest
|
||||||
|
setup do
|
||||||
|
sign_in users(:admin)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_new_api_user_creation_with_required_params
|
||||||
|
visit admin_api_users_url
|
||||||
|
click_link_or_button 'New API user'
|
||||||
|
|
||||||
|
fill_in 'Username', with: 'newtest'
|
||||||
|
fill_in 'Password', with: 'testtest'
|
||||||
|
find('#api_user_registrar_id', visible: false).set(registrars(:bestnames).id)
|
||||||
|
|
||||||
|
assert_difference 'ApiUser.count' do
|
||||||
|
click_link_or_button 'Save'
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_current_path admin_api_user_path(ApiUser.last)
|
||||||
|
assert_text 'Record created'
|
||||||
|
assert_text 'Username newtest'
|
||||||
|
assert_text 'Password testtest'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue