Tie access token directly to session
We need to present them differently in the session list and prevent them from being deleted
This commit is contained in:
committed by
Stanko K.R.
parent
b53c0a5385
commit
db29562c4c
@@ -1,13 +1,8 @@
|
||||
require "test_helper"
|
||||
|
||||
class Identity::AccessTokenTest < ActiveSupport::TestCase
|
||||
test "only one session at the time" do
|
||||
assert_changes -> { Session.count }, +1 do
|
||||
identity_access_tokens(:jasons_api_token).session
|
||||
end
|
||||
|
||||
assert_no_changes -> { Session.count } do
|
||||
identity_access_tokens(:jasons_api_token).session
|
||||
end
|
||||
test "new access token comes with a session" do
|
||||
access_token = identities(:david).access_tokens.create!
|
||||
assert_equal "Access Token", identities(:david).sessions.last.user_agent
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user