Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Created June 3, 2018 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelseatroy/44d7e66be16a7c6b9b65c26fde5ec687 to your computer and use it in GitHub Desktop.
Save chelseatroy/44d7e66be16a7c6b9b65c26fde5ec687 to your computer and use it in GitHub Desktop.
Switching Data Sources: Service Unit Test
require 'rails_helper'
RSpec.describe Services::ReceiptDataSource do
describe "get_receipts" do
it "makes appropriate call to canonical data service" do
@subject_under_test = Services::ReceiptDataSource.new
@subject_under_test.get_receipts
expect(WebMock).to have_requested(:get, "#{ENV['RECEIPT_ENDPOINT']}/receipts.json")
end
...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment