module GdsApi::TestHelpers::PublishingApiV2

def stub_publishing_api_postlike_call(method, content_id, body, resource_path, override_response_hash = {})

def stub_publishing_api_postlike_call(method, content_id, body, resource_path, override_response_hash = {})
  response_hash = { status: 200, body: '{}', headers: { "Content-Type" => "application/json; charset=utf-8" } }
  response_hash.merge!(override_response_hash)
  response_hash[:body] = response_hash[:body].to_json if response_hash[:body].is_a?(Hash)
  url = PUBLISHING_API_V2_ENDPOINT + resource_path + "/" + content_id
  stub_request(method, url).with(body: body).to_return(response_hash)
end