mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:21:23 +08:00
DEV: Move UserApiKey scopes to dedicated table (#10704)
This has no functional impact yet, but it is the first step in adding more granular scopes to UserApiKeys
This commit is contained in:
@ -174,7 +174,7 @@ describe UserApiKeysController do
|
||||
expect(parsed["api"]).to eq(4)
|
||||
|
||||
key = user.user_api_keys.first
|
||||
expect(key.scopes).to include("push")
|
||||
expect(key.scopes.map(&:name)).to include("push")
|
||||
expect(key.push_url).to eq("https://push.it/here")
|
||||
end
|
||||
|
||||
@ -208,7 +208,7 @@ describe UserApiKeysController do
|
||||
api_key = UserApiKey.with_key(parsed["key"]).first
|
||||
|
||||
expect(api_key.user_id).to eq(user.id)
|
||||
expect(api_key.scopes.sort).to eq(["push", "message_bus", "notifications", "session_info", "one_time_password"].sort)
|
||||
expect(api_key.scopes.map(&:name).sort).to eq(["push", "message_bus", "notifications", "session_info", "one_time_password"].sort)
|
||||
expect(api_key.push_url).to eq("https://push.it/here")
|
||||
|
||||
uri.query = ""
|
||||
|
Reference in New Issue
Block a user