Module: GdsApi::TestHelpers::SupportApi
- Defined in:
- lib/gds_api/test_helpers/support_api.rb
Constant Summary collapse
- SUPPORT_API_ENDPOINT =
Plek.current.find('support-api')
Instance Method Summary collapse
- #stub_support_api_service_feedback_creation(feedback_details = nil) ⇒ Object
- #support_api_isnt_available ⇒ Object
Instance Method Details
#stub_support_api_service_feedback_creation(feedback_details = nil) ⇒ Object
6 7 8 9 10 |
# File 'lib/gds_api/test_helpers/support_api.rb', line 6 def stub_support_api_service_feedback_creation(feedback_details = nil) post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/service-feedback") post_stub.with(:body => { service_feedback: feedback_details }) unless feedback_details.nil? post_stub.to_return(:status => 201) end |
#support_api_isnt_available ⇒ Object
12 13 14 |
# File 'lib/gds_api/test_helpers/support_api.rb', line 12 def support_api_isnt_available stub_request(:post, /#{SUPPORT_API_ENDPOINT}\/.*/).to_return(:status => 503) end |