Block non-localhost requests for all tests
authorTom Hughes <tom@compton.nu>
Tue, 10 Jul 2018 17:59:15 +0000 (18:59 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 10 Jul 2018 17:59:15 +0000 (18:59 +0100)
Only blocking them for the system tests didn't actually
work anyway as the setting is global so would apply to all
tests after the first system test.

test/application_system_test_case.rb
test/test_helper.rb

index 5b66f58..0f46ad3 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 require "capybara/poltergeist"
 
-WebMock.disable_net_connect!(:allow_localhost => true)
-
 # Work around weird debian/ubuntu phantomjs
 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817277
 # https://github.com/ariya/phantomjs/issues/14376
index 688cbc1..83cf909 100644 (file)
@@ -6,6 +6,8 @@ require_relative "../config/environment"
 require "rails/test_help"
 require "webmock/minitest"
 
+WebMock.disable_net_connect!(:allow_localhost => true)
+
 module ActiveSupport
   class TestCase
     include FactoryBot::Syntax::Methods