From 923d2d544658187ea7125f4fe395a281254d87bb Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 22 Feb 2018 18:03:48 +0200 Subject: [PATCH] Fix status code #693 --- app/controllers/registrar/domain_transfers_controller.rb | 2 +- test/integration/registrar/domain_transfers_test.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/registrar/domain_transfers_controller.rb b/app/controllers/registrar/domain_transfers_controller.rb index 0c72b2d93..7205f246c 100644 --- a/app/controllers/registrar/domain_transfers_controller.rb +++ b/app/controllers/registrar/domain_transfers_controller.rb @@ -51,7 +51,7 @@ class Registrar end end - if response.code == '204' + if response.code == '200' flash[:notice] = t '.transferred' redirect_to registrar_domains_url else diff --git a/test/integration/registrar/domain_transfers_test.rb b/test/integration/registrar/domain_transfers_test.rb index 46a92859b..c54790bb2 100644 --- a/test/integration/registrar/domain_transfers_test.rb +++ b/test/integration/registrar/domain_transfers_test.rb @@ -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'