Created
April 10, 2020 18:25
-
-
Save odlp/6d39768a72678dd30f68c098c4a642df to your computer and use it in GitHub Desktop.
Revisions
-
odlp created this gist
Apr 10, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ it "doesn't make further requests when the cache is warm" do stub = stub_request(:get, "www.amazon.com") Amazon::API.new.item_prices("id") Amazon::API.new.item_prices("id") # https://github.com/bblimke/webmock#setting-expectations-in-rspec-on-the-stub expect(stub).to have_been_requested.once end