Skip to content

Instantly share code, notes, and snippets.

@litvil
Created April 25, 2016 22:28
Show Gist options
  • Save litvil/4bd1c208939ce3beafb710450c749062 to your computer and use it in GitHub Desktop.
Save litvil/4bd1c208939ce3beafb710450c749062 to your computer and use it in GitHub Desktop.
Stub external request with Rspec
stub_request(:get, /some_host:9999/).with(headers: {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).to_return(status: 200, body: "stubbed response", headers: {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment