diff --git a/features/support/env.rb b/features/support/env.rb index 956e26888..2b977b574 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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 = [] page.driver.browser.manage.window.resize_to(1024, 500) diff --git a/features/support/webmock.rb b/features/support/webmock.rb new file mode 100644 index 000000000..017336779 --- /dev/null +++ b/features/support/webmock.rb @@ -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