mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Add tests on domain transfer
This commit is contained in:
parent
933f28490d
commit
44add87fe2
3 changed files with 15 additions and 7 deletions
|
@ -68,12 +68,15 @@ class APIDomainTransfersTest < ApplicationIntegrationTest
|
|||
|
||||
post '/repp/v1/domains/transfer', params: request_params, as: :json,
|
||||
headers: { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
|
||||
|
||||
assert_response :ok
|
||||
assert_equal ({ code: 1000,
|
||||
message: 'Command completed successfully',
|
||||
data: { success: [],
|
||||
failed: [{ type: "domain_transfer", domain_name: "shop.test" }] }}),
|
||||
failed: [{ type: "domain_transfer",
|
||||
domain_name: "shop.test",
|
||||
errors: [{:code=>"2304", :msg=>"Object status prohibits operation"}] }],
|
||||
}}),
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
end
|
||||
|
||||
|
|
|
@ -108,15 +108,18 @@ class APINameserversPutTest < ApplicationIntegrationTest
|
|||
domains(:shop).update!(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED])
|
||||
|
||||
params = { data: { type: 'nameserver', id: domains(:shop).nameservers.hostnames[0],
|
||||
attributes: { hostname: 'ns55.bestnames.test' } } }
|
||||
attributes: { hostname: 'ns55.bestnames.test' } } }
|
||||
put '/repp/v1/registrar/nameservers', params: params, as: :json,
|
||||
headers: { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
|
||||
|
||||
assert_response :ok
|
||||
assert_equal ({ code: 1000,
|
||||
message: 'Command completed successfully',
|
||||
data: { affected_domains: ["airport.test"],
|
||||
skipped_domains: ["shop.test"] }}),
|
||||
data: { type: "nameserver",
|
||||
id: "ns55.bestnames.test",
|
||||
attributes: {hostname: "ns55.bestnames.test"},
|
||||
affected_domains: ["airport.test"],
|
||||
skipped_domains: ["shop.test"]}}),
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue