Module: GdsApi::TestHelpers::GovUkDelivery
- Defined in:
- lib/gds_api/test_helpers/gov_uk_delivery.rb
Constant Summary collapse
- GOVUK_DELIVERY_ENDPOINT =
Plek.current.find('govuk-delivery')
Instance Method Summary collapse
- #stub_gov_uk_delivery_get_request(method, params_hash) ⇒ Object
- #stub_gov_uk_delivery_post_request(method, params_hash) ⇒ Object
Instance Method Details
#stub_gov_uk_delivery_get_request(method, params_hash) ⇒ Object
13 14 15 |
# File 'lib/gds_api/test_helpers/gov_uk_delivery.rb', line 13 def stub_gov_uk_delivery_get_request(method, params_hash) stub_request(:get, "#{GOVUK_DELIVERY_ENDPOINT}/#{method}?#{URI.encode_www_form(params_hash)}") end |
#stub_gov_uk_delivery_post_request(method, params_hash) ⇒ Object
9 10 11 |
# File 'lib/gds_api/test_helpers/gov_uk_delivery.rb', line 9 def stub_gov_uk_delivery_post_request(method, params_hash) stub_request(:post, "#{GOVUK_DELIVERY_ENDPOINT}/#{method}").with(body: params_hash.to_json) end |