Skip to content

Commit

Permalink
removed classic sdk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DjoykeAbyah committed Nov 5, 2024
1 parent ed4c050 commit 9bae0ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
33 changes: 0 additions & 33 deletions spec/checkout-oauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
36 changes: 0 additions & 36 deletions spec/checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 9bae0ac

Please sign in to comment.