projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/oauth-scopes-join' into 'develop'
[akkoma]
/
test
/
web
/
oauth
/
oauth_controller_test.exs
diff --git
a/test/web/oauth/oauth_controller_test.exs
b/test/web/oauth/oauth_controller_test.exs
index 53d83e6e8f9463d3764eda580bc990b7a13e206a..ed94416ff1a7d50f0d856431a9127b9f6ca1fc80 100644
(file)
--- a/
test/web/oauth/oauth_controller_test.exs
+++ b/
test/web/oauth/oauth_controller_test.exs
@@
-165,10
+165,10
@@
defmodule Pleroma.Web.OAuth.OAuthControllerTest do
test "issues a token for request with HTTP basic auth client credentials" do
user = insert(:user)
test "issues a token for request with HTTP basic auth client credentials" do
user = insert(:user)
- app = insert(:oauth_app, scopes: ["scope1", "scope2"])
+ app = insert(:oauth_app, scopes: ["scope1", "scope2"
, "scope3"
])
- {:ok, auth} = Authorization.create_authorization(app, user, ["scope2"])
- assert auth.scopes == ["scope2"]
+ {:ok, auth} = Authorization.create_authorization(app, user, ["scope
1", "scope
2"])
+ assert auth.scopes == ["scope
1", "scope
2"]
app_encoded =
(URI.encode_www_form(app.client_id) <> ":" <> URI.encode_www_form(app.client_secret))
app_encoded =
(URI.encode_www_form(app.client_id) <> ":" <> URI.encode_www_form(app.client_secret))
@@
-183,11
+183,13
@@
defmodule Pleroma.Web.OAuth.OAuthControllerTest do
"redirect_uri" => app.redirect_uris
})
"redirect_uri" => app.redirect_uris
})
- assert %{"access_token" => token} = json_response(conn, 200)
+ assert %{"access_token" => token, "scope" => scope} = json_response(conn, 200)
+
+ assert scope == "scope1 scope2"
token = Repo.get_by(Token, token: token)
assert token
token = Repo.get_by(Token, token: token)
assert token
- assert token.scopes == ["scope2"]
+ assert token.scopes == ["scope
1", "scope
2"]
end
test "rejects token exchange with invalid client credentials" do
end
test "rejects token exchange with invalid client credentials" do