We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c63ed77 commit b1465f3Copy full SHA for b1465f3
1 file changed
test/models/profile_test.rb
@@ -82,13 +82,17 @@ class ProfileTest < ActiveSupport::TestCase
82
refute profile.errors.added?(:website, 'is blocked')
83
84
# private address is not OK
85
- with_net_connection do # Allow request through to be caught by private_address_check
+ WebMock.allow_net_connect!
86
+ assert PrivateAddressCheck.resolves_to_private_address?('192.168.0.1')
87
+ VCR.turned_off do
88
refute profile.update(website: 'http://192.168.0.1')
89
assert profile.errors.added?(:website, 'is not accessible')
90
end
91
92
# address that times out is OK
93
assert profile.update(website: 'http://slowhost.com')
94
refute profile.errors.added?(:website, 'is not accessible')
95
+ ensure
96
+ WebMock.disable_net_connect!(allow_localhost: true)
97
98
0 commit comments