test/controller/rescue_test.rb in actionpack-2.3.5 vs test/controller/rescue_test.rb in actionpack-2.3.6
- old
+ new
@@ -279,18 +279,24 @@
assert @response.body.include?('RescueController#raises'), "Response should include controller and action."
assert @response.body.include?("don't panic"), "Response should include exception message."
end
def test_local_request_when_remote_addr_is_localhost
- @controller.expects(:request).returns(@request).at_least_once
+ @controller.expects(:request).returns(@request).at_least(4)
with_remote_addr '127.0.0.1' do
assert @controller.send(:local_request?)
end
+ with_remote_addr '::1' do
+ assert @controller.send(:local_request?)
+ end
end
def test_local_request_when_remote_addr_isnt_locahost
- @controller.expects(:request).returns(@request)
+ @controller.expects(:request).returns(@request).at_least(4)
with_remote_addr '1.2.3.4' do
+ assert !@controller.send(:local_request?)
+ end
+ with_remote_addr '2002::102:304' do
assert !@controller.send(:local_request?)
end
end
def test_rescue_responses