diff options
author | azul <azul@leap.se> | 2014-05-26 10:08:27 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2014-05-26 10:08:27 +0200 |
commit | 1d0d61389011a8d0d169bc139590d90a6fbbac60 (patch) | |
tree | 9746836914f455889af9e24fdff36a1241ef4b24 /test/support/auth_test_helper.rb | |
parent | df298887221cffc8cacc8965d73a0d7850118849 (diff) | |
parent | 5764daae090227bf4c5967900b708392c967be47 (diff) |
Merge pull request #163 from azul/feature/3398-save-hashed-token
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.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb index e1961aa..38c2ea1 100644 --- a/test/support/auth_test_helper.rb +++ b/test/support/auth_test_helper.rb @@ -50,8 +50,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 |