Moved RSpec Webmock configuration in own support file and allowed requests to Google for Calendar setup.
This commit is contained in:
parent
2d8badcb8c
commit
ee176d3761
2 changed files with 12 additions and 3 deletions
|
@ -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"
|
||||
|
|
12
spec/support/webmock.rb
Normal file
12
spec/support/webmock.rb
Normal file
|
@ -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
|
||||
)
|
Loading…
Reference in a new issue