Skip to content

Instantly share code, notes, and snippets.

@BradleyJohnson
Last active May 19, 2016 05:27
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 BradleyJohnson/fa21cb145996bbeb70adaf44650ff464 to your computer and use it in GitHub Desktop.
Save BradleyJohnson/fa21cb145996bbeb70adaf44650ff464 to your computer and use it in GitHub Desktop.
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'the_geek'
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config|
config.before(:each) do
stub_request(:get, /www.boardgamegeek.com/).
with(headers: {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
to_return(status: 200, body: "stubbed response", headers: {})
stub_request(:get, /www.boardgamegeek.com/).
with(headers: {'Accept'=>'*/*', 'User-Agent'=>'SOME 404 STRING'}).
to_return(status: 404, body: "Not Found", headers: {})
stub_request(:get, /www.boardgamegeek.com/).
with(headers: {'Accept'=>'*/*', 'User-Agent'=>'SOME 503 STRING'}).
to_return(status: 503, body: "Not Found", headers: {})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment