mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +02:00
Registrant API: Verify new contact link(s) structure
This commit is contained in:
parent
434509f150
commit
1d1c336117
1 changed files with 9 additions and 0 deletions
|
@ -57,6 +57,15 @@ class RegistrantApiContactsTest < ApplicationIntegrationTest
|
|||
assert_equal({ errors: [base: ['Not authorized']] }, json_body)
|
||||
end
|
||||
|
||||
def test_gets_contact_domain_links_when_requested
|
||||
get "/api/v1/registrant/contacts/#{@contact.uuid}?links=true", headers: @auth_headers
|
||||
|
||||
expected_links = @contact.domains.uniq.map { |d| { name: d.name, id: d.uuid }}
|
||||
assert_response :ok
|
||||
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_empty expected_links - response_json[:links]
|
||||
end
|
||||
private
|
||||
|
||||
def auth_token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue