summaryrefslogtreecommitdiff
path: root/users/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-08-27 14:36:27 +0200
committerAzul <azul@leap.se>2013-08-27 14:57:44 +0200
commit420bfb326f974eec14b04d6a170ed2d28c14180f (patch)
tree98c34aef55d87dbf3cbce3569d6d85f3c52a9e48 /users/test/functional
parente60ee749cab0f80cf23ca57e28c7de6d1b3a395b (diff)
clear token on logout with test
Diffstat (limited to 'users/test/functional')
-rw-r--r--users/test/functional/v1/sessions_controller_test.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/users/test/functional/v1/sessions_controller_test.rb b/users/test/functional/v1/sessions_controller_test.rb
index 8a16997..ff9fca1 100644
--- a/users/test/functional/v1/sessions_controller_test.rb
+++ b/users/test/functional/v1/sessions_controller_test.rb
@@ -52,20 +52,18 @@ class V1::SessionsControllerTest < ActionController::TestCase
assert_equal @user.id, token.user_id
end
- test "logout should reset warden user" do
+ test "logout should reset session" do
expect_warden_logout
delete :destroy
assert_response 204
end
- test "logout should remove token" do
+ test "logout should destroy token" do
login
expect_warden_logout
- skip "TODO: implement token removal"
- assert_difference "Token.count", -1 do
- delete :destroy
- assert_response 204
- end
+ @token.expects(:destroy)
+ delete :destroy
+ assert_response 204
end
def expect_warden_logout
@@ -76,5 +74,4 @@ class V1::SessionsControllerTest < ActionController::TestCase
request.env['warden'].expects(:logout)
end
-
end