Allow more Webdrivers update URLs in spec
Follow advise from the webdrivers wiki
This commit is contained in:
parent
50130ba090
commit
559c2b9ab0
2 changed files with 13 additions and 4 deletions
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
# Mock external requests to youtube
|
# Mock external requests to youtube
|
||||||
require 'webmock/rspec'
|
require 'webmock/rspec'
|
||||||
driver_urls = Webdrivers::Common.subclasses.map do |driver|
|
|
||||||
Addressable::URI.parse(driver.base_url).host
|
|
||||||
end
|
|
||||||
WebMock.disable_net_connect!(allow_localhost: true, allow: [*driver_urls, /stripe.com/])
|
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.before(:each) do
|
config.before(:each) do
|
||||||
|
|
|
||||||
13
spec/support/webmock.rb
Normal file
13
spec/support/webmock.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Allow webdriver update urls
|
||||||
|
# from https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock
|
||||||
|
allowed_urls = Webdrivers::Common.subclasses.map(&:base_url)
|
||||||
|
allowed_urls << /geckodriver/
|
||||||
|
# We've seen [a redirect](https://github.com/titusfortner/webdrivers/issues/204) to this domain
|
||||||
|
allowed_urls += ['github-releases.githubusercontent.com']
|
||||||
|
|
||||||
|
# Allow stripe.com for stripe integration tests
|
||||||
|
allowed_urls += ['stripe.com']
|
||||||
|
|
||||||
|
WebMock.disable_net_connect!(allow_localhost: true, allow: allowed_urls)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue