Module: GdsApi::TestHelpers::PerformancePlatform::DataOut

Defined in:
lib/gds_api/test_helpers/performance_platform/data_out.rb

Constant Summary collapse

PP_DATA_OUT_ENDPOINT =
"http://www.performance.service.gov.uk".freeze

Instance Method Summary collapse

Instance Method Details

#stub_data_set_not_available(slug) ⇒ Object



12
13
14
15
# File 'lib/gds_api/test_helpers/performance_platform/data_out.rb', line 12

def stub_data_set_not_available(slug)
  stub_http_request(:get, "#{PP_DATA_OUT_ENDPOINT}/data/#{slug}/customer-satisfaction").
    to_return(status: 404)
end

#stub_service_feedback(slug, response_body = {}) ⇒ Object



7
8
9
10
# File 'lib/gds_api/test_helpers/performance_platform/data_out.rb', line 7

def stub_service_feedback(slug, response_body = {})
  stub_http_request(:get, "#{PP_DATA_OUT_ENDPOINT}/data/#{slug}/customer-satisfaction").
    to_return(status: 200, body: response_body.to_json)
end

#stub_service_not_availableObject



17
18
19
# File 'lib/gds_api/test_helpers/performance_platform/data_out.rb', line 17

def stub_service_not_available
  stub_request(:any, /#{PP_DATA_OUT_ENDPOINT}\/.*/).to_return(status: 503)
end