Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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