summaryrefslogtreecommitdiff
path: root/test/support/auth_test_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-01 10:45:57 +0200
committerAzul <azul@leap.se>2014-05-26 09:58:40 +0200
commit5764daae090227bf4c5967900b708392c967be47 (patch)
treed611429113b8b0ebc363f8b0333c6896a41c7ced /test/support/auth_test_helper.rb
parent0f686b1256b4190522bcb101ba06cd2c7406eb36 (diff)
hash token with sha512 against timing attacs #3398
Diffstat (limited to 'test/support/auth_test_helper.rb')
-rw-r--r--test/support/auth_test_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb
index 57f9f9b..28e9633 100644
--- a/test/support/auth_test_helper.rb
+++ b/test/support/auth_test_helper.rb
@@ -46,8 +46,9 @@ module AuthTestHelper
protected
def header_for_token_auth
- @token = find_record(:token, :authenticate => @current_user)
- ActionController::HttpAuthentication::Token.encode_credentials @token.id
+ @token = stub_record(:token, :authenticate => @current_user)
+ Token.stubs(:find_by_token).with(@token.token).returns(@token)
+ ActionController::HttpAuthentication::Token.encode_credentials @token.token
end
def expect_warden_logout