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:
David Taylor
2020-09-29 10:57:48 +01:00
committed by GitHub
parent 91ac70a32d
commit 1ba9b34b03
11 changed files with 98 additions and 20 deletions

View File

@ -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 = ""