Module: Adyen::API::RecurringService::TestHelpers
- Included in:
- Adyen::API::RecurringService
- Defined in:
- lib/adyen/api/test_helpers.rb
Overview
A collection of test helpers that create and assign stubbed response instances for a subsequent remote call.
This module extends the Adyen::API::RecurringService class and thus these methods are callable on it.
Constant Summary collapse
- DISABLE_RESPONSE =
SimpleSOAPClient::ENVELOPE % <<-EOXML <ns1:disableResponse xmlns:ns1="http://recurring.services.adyen.com"> <ns1:result> <response xmlns="http://recurring.services.adyen.com"> %s </response> </ns1:result> </ns1:disableResponse> EOXML
Instance Method Summary collapse
-
#disabled_stub ⇒ DisableResponse
A ‘disable succeeded’ response instance.
-
#stub_disabled! ⇒ Object
Assigns a #disabled_stub, meaning the subsequent disable request will be successful.
Instance Method Details
#disabled_stub ⇒ DisableResponse
Returns A ‘disable succeeded’ response instance.
118 119 120 121 122 |
# File 'lib/adyen/api/test_helpers.rb', line 118 def disabled_stub http_response = Net::HTTPOK.new('1.1', '200', 'OK') def http_response.body; DISABLE_RESPONSE % DisableResponse::DISABLED_RESPONSES.first; end RecurringService::DisableResponse.new(http_response) end |
#stub_disabled! ⇒ Object
Assigns a #disabled_stub, meaning the subsequent disable request will be successful.
125 126 127 |
# File 'lib/adyen/api/test_helpers.rb', line 125 def stub_disabled! @stubbed_response = disabled_stub end |