1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

test for trackable behind a proxy

This commit is contained in:
salidux 2011-10-22 11:57:18 -02:00
parent 60822641cb
commit d11402612f

View file

@ -37,6 +37,17 @@ class TrackableHooksTest < ActionController::IntegrationTest
assert_equal "127.0.0.1", user.last_sign_in_ip assert_equal "127.0.0.1", user.last_sign_in_ip
end end
test "current remote ip returns original ip behind a non transparent proxy" do
user = create_user
arbitrary_ip = '192.168.1.69'
sign_in_as_user do
header 'HTTP_X_FORWARDED_FOR', arbitrary_ip
end
user.reload
assert_equal arbitrary_ip, user.current_sign_in_ip
end
test "increase sign in count" do test "increase sign in count" do
user = create_user user = create_user
assert_equal 0, user.sign_in_count assert_equal 0, user.sign_in_count