it "calculates tax" do item = create(:item) shopping_cart = ShoppingCart.new(item) allow(QuoteService).to receive(:fetch).and_return(100) expect(shopping_cart.tax).to eq 10 end end # This approach is useful when unit-testing objects that # depend on data from other services. 5
:json JSON.generate(THOUGHTBOT_MEMBER.merge(id: params[:id])) end end # rails_helper.rb RSpec.configure do |config| config.before(:each) do stub_request(:any, /api.trello.com/).to_rack(FakeTrello) end end 1