mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Merge pull request #722 from internetee/registry-693
REST API: Return successful domain transfers
This commit is contained in:
commit
7c45a85cea
7 changed files with 17 additions and 12 deletions
|
@ -10,7 +10,10 @@ class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
|||
post '/repp/v1/domain_transfers', request_params, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
assert_response 200
|
||||
assert_equal ({ data: [{
|
||||
type: 'domain_transfer'
|
||||
type: 'domain_transfer',
|
||||
attributes: {
|
||||
domain_name: 'shop.test'
|
||||
},
|
||||
}] }),
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
end
|
||||
|
|
|
@ -7,12 +7,14 @@ class RegistrarDomainTransfersTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
def test_batch_transfer_succeeds
|
||||
body = { data: { domainTransfers: [{ domainName: 'shop.test', transferCode: '65078d5' }] } }
|
||||
request_body = { data: { domainTransfers: [{ domainName: 'shop.test', transferCode: '65078d5' }] } }
|
||||
headers = { 'Content-type' => 'application/json' }
|
||||
request_stub = stub_request(:post, /domain_transfers/).with(body: body,
|
||||
request_stub = stub_request(:post, /domain_transfers/).with(body: request_body,
|
||||
headers: headers,
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(status: 204)
|
||||
.to_return(body: { data: [{
|
||||
type: 'domain_transfer'
|
||||
}] }.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Transfer'
|
||||
|
@ -23,7 +25,7 @@ class RegistrarDomainTransfersTest < ActionDispatch::IntegrationTest
|
|||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Domains have been successfully transferred'
|
||||
assert_text '1 domains have been successfully transferred'
|
||||
end
|
||||
|
||||
def test_batch_transfer_fails_gracefully
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue