Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: addeed extended data from registrant #1876

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/serializers/registrant_api/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def to_json(_obj = nil)
registrant: {
name: domain.registrant.name,
id: domain.registrant.uuid,
ident: domain.registrant.ident,
ident_type: domain.registrant.ident_type,
ident_country_code: domain.registrant.ident_country_code,
phone: domain.registrant.phone,
email: domain.registrant.email,
org: domain.registrant.org?,
},
tech_contacts: contacts(:tech),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ def test_get_domain_details_by_uuid

assert_equal('hospital.test', domain[:name])
assert_equal('5edda1a5-3548-41ee-8b65-6d60daf85a37', domain[:id])
assert_equal({name: 'John', id: 'eb2f2766-b44c-4e14-9f16-32ab1a7cb957', org: false}, domain[:registrant])
assert_equal({:name=>"John",
:id=>"eb2f2766-b44c-4e14-9f16-32ab1a7cb957",
:ident=>"1234", :ident_type=>"priv",
:ident_country_code=>"US",
:phone=>"+555.555",
:email=>"john@inbox.test",
:org=>false},
domain[:registrant])
assert_equal([{name: 'John',
id: 'eb2f2766-b44c-4e14-9f16-32ab1a7cb957',
email: 'john@inbox.test'}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ def test_locking_domains_returns_serialized_domain_object
response_json = JSON.parse(response.body, symbolize_names: true)

assert_equal({ name: 'Best Names', website: 'https://bestnames.test' }, response_json[:registrar])
assert_equal({name: 'John', id: 'eb2f2766-b44c-4e14-9f16-32ab1a7cb957', org: false}, response_json[:registrant])
assert_equal({:name=>"John",
:id=>"eb2f2766-b44c-4e14-9f16-32ab1a7cb957",
:ident=>"1234",
:ident_type=>"priv",
:ident_country_code=>"US",
:phone=>"+555.555",
:email=>"john@inbox.test",
:org=>false},
response_json[:registrant])
assert_equal([{name: 'Jane',
id: '9db3de62-2414-4487-bee2-d5c155567768',
email: 'jane@mail.test'
Expand Down
9 changes: 8 additions & 1 deletion test/lib/serializers/registrant_api/domain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ def test_returns_registrar_name
end

def test_returns_registrant_name_uuid_and_org
assert_equal({name: 'John', id: 'eb2f2766-b44c-4e14-9f16-32ab1a7cb957', org: false},
assert_equal({:name=>"John",
:id=>"eb2f2766-b44c-4e14-9f16-32ab1a7cb957",
:ident=>"1234",
:ident_type=>"priv",
:ident_country_code=>"US",
:phone=>"+555.555",
:email=>"john@inbox.test",
:org=>false},
@json[:registrant])
end

Expand Down