@@ -73,24 +73,22 @@ class ProfileTest < ActiveSupport::TestCase
7373 # accessible domain
7474 assert profile . update ( website : 'http://200host.com' )
7575
76- # blocked domain
76+ # blocked domain is not OK
7777 refute profile . update ( website : 'https://bad-domain.example/' )
7878 assert profile . errors . added? ( :website , 'is blocked' )
79- refute profile . errors . added? ( :website , 'is not accessible' ) , 'connection should not be attempted to blocked domains'
8079
81- # inaccessible domain
82- refute profile . update ( website : 'http://404host.com' )
83- assert profile . errors . added? ( :website , 'is not accessible' )
80+ # inaccessible domain is OK
81+ assert profile . update ( website : 'http://404host.com' )
8482 refute profile . errors . added? ( :website , 'is blocked' )
8583
86- # private address
84+ # private address is not OK
8785 with_net_connection do # Allow request through to be caught by private_address_check
88- refute profile . update ( website : 'http://127.0 .0.1' )
86+ refute profile . update ( website : 'http://192.168 .0.1' )
8987 assert profile . errors . added? ( :website , 'is not accessible' )
9088 end
9189
92- # address that times out
93- refute profile . update ( website : 'http://slowhost.com' )
94- assert profile . errors . added? ( :website , 'is not accessible' )
90+ # address that times out is OK
91+ assert profile . update ( website : 'http://slowhost.com' )
92+ refute profile . errors . added? ( :website , 'is not accessible' )
9593 end
9694end
0 commit comments