diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 94bb1a4bf..81792f90d 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -30,9 +30,6 @@ ActiveRecord::Migration.maintain_test_schema! # make sure that all migrations of linked packages are executed Package::Migration.linked -# allow requests to Zammad webservices -WebMock.disable_net_connect!(allow: /zammad\.com/) - RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{::Rails.root}/spec/fixtures" diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb new file mode 100644 index 000000000..2c11259b6 --- /dev/null +++ b/spec/support/webmock.rb @@ -0,0 +1,12 @@ +# allow requests to: +# - Zammad webservices +# - Google (calendar) +allowed_sites = lambda do |uri| + ['zammad.com', 'google.com'].any? do |site| + uri.host.include?(site) + end +end +WebMock.disable_net_connect!( + allow: allowed_sites, + allow_localhost: true +)