summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-05-26 10:08:27 +0200
committerazul <azul@leap.se>2014-05-26 10:08:27 +0200
commit1d0d61389011a8d0d169bc139590d90a6fbbac60 (patch)
tree9746836914f455889af9e24fdff36a1241ef4b24 /test/functional
parentdf298887221cffc8cacc8965d73a0d7850118849 (diff)
parent5764daae090227bf4c5967900b708392c967be47 (diff)
Merge pull request #163 from azul/feature/3398-save-hashed-token
hash token with sha512 against timing attacs #3398
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/test_helpers_test.rb2
-rw-r--r--test/functional/v1/sessions_controller_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/test_helpers_test.rb b/test/functional/test_helpers_test.rb
index 845e516..ca85482 100644
--- a/test/functional/test_helpers_test.rb
+++ b/test/functional/test_helpers_test.rb
@@ -27,7 +27,7 @@ class TestHelpersTest < ActionController::TestCase
def test_login_adds_token_header
login
token_present = @controller.authenticate_with_http_token do |token, options|
- assert_equal @token.id, token
+ assert_equal @token.to_s, token
end
# authenticate_with_http_token just returns nil and does not
# execute the block if there is no token. So we have to also
diff --git a/test/functional/v1/sessions_controller_test.rb b/test/functional/v1/sessions_controller_test.rb
index df0d681..8bb6acd 100644
--- a/test/functional/v1/sessions_controller_test.rb
+++ b/test/functional/v1/sessions_controller_test.rb
@@ -48,7 +48,7 @@ class V1::SessionsControllerTest < ActionController::TestCase
assert_response :success
assert json_response.keys.include?("id")
assert json_response.keys.include?("token")
- assert token = Token.find(json_response['token'])
+ assert token = Token.find_by_token(json_response['token'])
assert_equal @user.id, token.user_id
end