mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Rename auth_info / authorization_code to transfer_code
This commit is contained in:
parent
6e624a7898
commit
117b682990
5 changed files with 32 additions and 6 deletions
|
@ -110,4 +110,28 @@ class ReppV1DomainsCreateTest < ActionDispatch::IntegrationTest
|
|||
assert_equal tech_contact, domain.tech_domain_contacts.first.contact
|
||||
assert_equal admin_contact, domain.admin_domain_contacts.first.contact
|
||||
end
|
||||
|
||||
def test_creates_new_domain_with_desired_transfer_code
|
||||
@auth_headers['Content-Type'] = 'application/json'
|
||||
contact = contacts(:john)
|
||||
|
||||
payload = {
|
||||
domain: {
|
||||
name: 'domeener.test',
|
||||
registrant: contact.code,
|
||||
transfer_code: 'ABADIATS',
|
||||
period: 1,
|
||||
period_unit: 'y'
|
||||
}
|
||||
}
|
||||
|
||||
post "/repp/v1/domains", headers: @auth_headers, params: payload.to_json
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
assert_response :ok
|
||||
assert_equal 1000, json[:code]
|
||||
assert_equal 'Command completed successfully', json[:message]
|
||||
|
||||
assert @user.registrar.domains.find_by(name: 'domeener.test').present?
|
||||
assert_equal 'ABADIATS', @user.registrar.domains.find_by(name: 'domeener.test').transfer_code
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue