projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'openapi/scheduled_activities' into 'develop'
[akkoma]
/
test
/
web
/
masto_fe_controller_test.exs
diff --git
a/test/web/masto_fe_controller_test.exs
b/test/web/masto_fe_controller_test.exs
index b5dbd4a25d3e201931644922eb42772227b20d55..1d107d56c0087bab1f910a7af684593437447d5d 100644
(file)
--- a/
test/web/masto_fe_controller_test.exs
+++ b/
test/web/masto_fe_controller_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.MastoFEController do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.MastoFEController do
@@
-10,7
+10,7
@@
defmodule Pleroma.Web.MastodonAPI.MastoFEController do
import Pleroma.Factory
import Pleroma.Factory
- clear_config([:instance, :public])
+
setup do:
clear_config([:instance, :public])
test "put settings", %{conn: conn} do
user = insert(:user)
test "put settings", %{conn: conn} do
user = insert(:user)
@@
-18,6
+18,7
@@
defmodule Pleroma.Web.MastodonAPI.MastoFEController do
conn =
conn
|> assign(:user, user)
conn =
conn
|> assign(:user, user)
+ |> assign(:token, insert(:oauth_token, user: user, scopes: ["write:accounts"]))
|> put("/api/web/settings", %{"data" => %{"programming" => "socks"}})
assert _result = json_response(conn, 200)
|> put("/api/web/settings", %{"data" => %{"programming" => "socks"}})
assert _result = json_response(conn, 200)
@@
-63,12
+64,12
@@
defmodule Pleroma.Web.MastodonAPI.MastoFEController do
end
test "does not redirect logged in users to the login page", %{conn: conn, path: path} do
end
test "does not redirect logged in users to the login page", %{conn: conn, path: path} do
- token = insert(:oauth_token)
+ token = insert(:oauth_token
, scopes: ["read"]
)
conn =
conn
|> assign(:user, token.user)
conn =
conn
|> assign(:user, token.user)
- |>
put_session(:oauth_token, token.
token)
+ |>
assign(:token,
token)
|> get(path)
assert conn.status == 200
|> get(path)
assert conn.status == 200