Skip to content

Commit

Permalink
test for trackable behind a proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
salidux committed Oct 22, 2011
1 parent 6082264 commit d114026
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/integration/trackable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ class TrackableHooksTest < ActionController::IntegrationTest
assert_equal "127.0.0.1", user.current_sign_in_ip
assert_equal "127.0.0.1", user.last_sign_in_ip
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
user = create_user
Expand Down

0 comments on commit d114026

Please sign in to comment.