Disable all network requests in Cucumber suite

closes #6368
This commit is contained in:
Jonne Haß 2015-08-29 23:04:46 +02:00
parent 1874c37706
commit 1223699f76
2 changed files with 11 additions and 3 deletions

View file

@ -68,9 +68,6 @@ require Rails.root.join('spec', 'support', 'inlined_jobs')
require Rails.root.join('spec', 'support', 'user_methods')
include HelperMethods
# require 'webmock/cucumber'
# WebMock.disable_net_connect!(:allow_localhost => true)
Before do
Devise.mailer.deliveries = []
end

View file

@ -0,0 +1,11 @@
require "webmock/cucumber"
WebMock.disable_net_connect!(allow_localhost: true)
Before do
stub_request(:head, /.+/).with(
headers: {
"Accept" => "text/html",
"User-Agent" => "OpenGraphReader/0.6.1 (+https://github.com/jhass/open_graph_reader)"
}
).to_return(status: 200, body: "", headers: {"Content-Type" => "text/plain"})
end