module GdsApi::TestHelpers::ContentApi

def stub_content_api_default_artefact

Stub requests, and then dynamically generate a response based on the slug in the request
def stub_content_api_default_artefact
  stub_request(:get, %r{\A#{CONTENT_API_ENDPOINT}/[a-z0-9-]+\.json}).to_return { |request|
    slug = request.uri.path.split('/').last.chomp('.json')
    {:body => artefact_for_slug(slug).to_json}
  }
end