Return domain name in domain transfers API

#693
This commit is contained in:
Artur Beljajev 2018-02-22 18:27:00 +02:00
parent 923d2d5446
commit 0eca515c3d
2 changed files with 5 additions and 2 deletions

View file

@ -26,7 +26,7 @@ module Repp
if domain if domain
if domain.transfer_code == transfer_code if domain.transfer_code == transfer_code
domain.transfer(new_registrar) domain.transfer(new_registrar)
successful_domain_transfers << { type: 'domain_transfer' } successful_domain_transfers << { type: 'domain_transfer', attributes: { domain_name: domain.name } }
else else
errors << { title: "#{domain_name} transfer code is wrong" } errors << { title: "#{domain_name} transfer code is wrong" }
end end

View file

@ -8,7 +8,10 @@ class APIDomainTransfersTest < ActionDispatch::IntegrationTest
assert_equal registrars(:goodnames), domains(:shop).registrar assert_equal registrars(:goodnames), domains(:shop).registrar
assert_response 200 assert_response 200
assert_equal ({ data: [{ assert_equal ({ data: [{
type: 'domain_transfer' type: 'domain_transfer',
attributes: {
domain_name: 'shop.test'
},
}] }), }] }),
JSON.parse(response.body, symbolize_names: true) JSON.parse(response.body, symbolize_names: true)
end end