[#923] Refactored OAuthController#authorize definitions, added test.
This commit is contained in:
parent
ad157f16b2
commit
9256d2d4b4
2 changed files with 36 additions and 10 deletions
|
|
@ -365,6 +365,27 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
|
|||
assert html_response(conn, 200) =~ ~s(type="submit")
|
||||
end
|
||||
|
||||
test "properly handles internal calls with `authorization`-wrapped params", %{
|
||||
app: app,
|
||||
conn: conn
|
||||
} do
|
||||
conn =
|
||||
get(
|
||||
conn,
|
||||
"/oauth/authorize",
|
||||
%{
|
||||
"authorization" => %{
|
||||
"response_type" => "code",
|
||||
"client_id" => app.client_id,
|
||||
"redirect_uri" => app.redirect_uris,
|
||||
"scope" => "read"
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
assert html_response(conn, 200) =~ ~s(type="submit")
|
||||
end
|
||||
|
||||
test "renders authentication page if user is already authenticated but `force_login` is tru-ish",
|
||||
%{app: app, conn: conn} do
|
||||
token = insert(:oauth_token, app_id: app.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue