summaryrefslogtreecommitdiff
path: root/users/test/functional/v1
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-10-30 20:13:16 +0100
committerAzul <azul@leap.se>2013-10-30 20:17:43 +0100
commitf6924bfe3b540c384fa53e55db9db3a64a34ced3 (patch)
tree23625c0daafbaade2a1aeb9bf9b17070f1f67d51 /users/test/functional/v1
parentdd88c7f84cb3c497c6327c364b3c08993c51a08f (diff)
test helper to expect_logout.
Currently it expects both the session and the token to be cleared. This might change. But we'll always have a definition of what it means to logout we can test this way.
Diffstat (limited to 'users/test/functional/v1')
-rw-r--r--users/test/functional/v1/sessions_controller_test.rb19
1 files changed, 2 insertions, 17 deletions
diff --git a/users/test/functional/v1/sessions_controller_test.rb b/users/test/functional/v1/sessions_controller_test.rb
index ff9fca1..4200e8f 100644
--- a/users/test/functional/v1/sessions_controller_test.rb
+++ b/users/test/functional/v1/sessions_controller_test.rb
@@ -52,26 +52,11 @@ class V1::SessionsControllerTest < ActionController::TestCase
assert_equal @user.id, token.user_id
end
- test "logout should reset session" do
- expect_warden_logout
- delete :destroy
- assert_response 204
- end
-
- test "logout should destroy token" do
+ test "destroy should logout" do
login
- expect_warden_logout
- @token.expects(:destroy)
+ expect_logout
delete :destroy
assert_response 204
end
- def expect_warden_logout
- raw = mock('raw session') do
- expects(:inspect)
- end
- request.env['warden'].expects(:raw_session).returns(raw)
- request.env['warden'].expects(:logout)
- end
-
end