From 9bae0ac8b12cfa0eda88a3ca5e3038892b4bf4cc Mon Sep 17 00:00:00 2001 From: Djoyke Reijans <115019123+DjoykeAbyah@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:54:38 +0000 Subject: [PATCH] removed classic sdk tests --- spec/checkout-oauth_spec.rb | 33 --------------------------------- spec/checkout_spec.rb | 36 ------------------------------------ 2 files changed, 69 deletions(-) diff --git a/spec/checkout-oauth_spec.rb b/spec/checkout-oauth_spec.rb index bda8f756..b1ca6d9e 100644 --- a/spec/checkout-oauth_spec.rb +++ b/spec/checkout-oauth_spec.rb @@ -105,39 +105,6 @@ to eq("RedirectShopper") end - # must be created manually due to payments/result format - it "makes a payments/result call" do - request_body = JSON.parse(json_from_file("mocks/requests/Checkout/payment-result.json")) - - response_body = json_from_file("mocks/responses/Checkout/payment-result.json") - - url = @shared_values[:client].service_url(@shared_values[:service], "payments/result", @shared_values[:client].checkout.version) - WebMock.stub_request(:post, url). - with( - body: request_body, - headers: @auth_header - ). - to_return( - body: response_body - ) - - result = @shared_values[:client].checkout.classic_checkout_sdk_api.verify_payment_result(request_body) - response_hash = result.response - - expect(result.status). - to eq(200) - expect(response_hash). - to eq(JSON.parse(response_body)) - expect(response_hash). - to be_a Adyen::HashWithAccessors - expect(response_hash). - to be_a_kind_of Hash - expect(response_hash["resultCode"]). - to eq("Authorised") - expect(response_hash.resultCode). - to eq("Authorised") - end - # must be created manually due to paymentsLinks format it "makes a paymentLinks call" do request_body = JSON.parse(json_from_file("mocks/requests/Checkout/payment_links.json")) diff --git a/spec/checkout_spec.rb b/spec/checkout_spec.rb index c3323943..2c0e6739 100644 --- a/spec/checkout_spec.rb +++ b/spec/checkout_spec.rb @@ -112,42 +112,6 @@ .to eq('RedirectShopper') end - # must be created manually due to payments/result format - it 'makes a payments/result call' do - request_body = JSON.parse(json_from_file('mocks/requests/Checkout/payment-result.json')) - - response_body = json_from_file('mocks/responses/Checkout/payment-result.json') - - url = @shared_values[:client].service_url(@shared_values[:service], 'payments/result', - @shared_values[:client].checkout.version) - WebMock.stub_request(:post, url) - .with( - body: request_body, - headers: { - 'x-api-key' => @shared_values[:client].api_key - } - ) - .to_return( - body: response_body - ) - - result = @shared_values[:client].checkout.classic_checkout_sdk_api.verify_payment_result(request_body) - response_hash = result.response - - expect(result.status) - .to eq(200) - expect(response_hash) - .to eq(JSON.parse(response_body)) - expect(response_hash) - .to be_a Adyen::HashWithAccessors - expect(response_hash) - .to be_a_kind_of Hash - expect(response_hash['resultCode']) - .to eq('Authorised') - expect(response_hash.resultCode) - .to eq('Authorised') - end - # must be created manually due to paymentsLinks format it 'makes a paymentLinks call' do request_body = JSON.parse(json_from_file('mocks/requests/Checkout/payment_links.json'))