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:
parent
60822641cb
commit
d11402612f
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue