projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/develop' into restrict-domain
[akkoma]
/
test
/
plugs
/
user_is_admin_plug_test.exs
diff --git
a/test/plugs/user_is_admin_plug_test.exs
b/test/plugs/user_is_admin_plug_test.exs
index 9e05fff18aca5a3277063342bffacf8201fccf27..8bc00e44497a58dafcdb48600fe07ca88880955f 100644
(file)
--- a/
test/plugs/user_is_admin_plug_test.exs
+++ b/
test/plugs/user_is_admin_plug_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
18
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserIsAdminPlugTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserIsAdminPlugTest do
@@
-8,21
+8,17
@@
defmodule Pleroma.Plugs.UserIsAdminPlugTest do
alias Pleroma.Plugs.UserIsAdminPlug
import Pleroma.Factory
alias Pleroma.Plugs.UserIsAdminPlug
import Pleroma.Factory
- test "accepts a user that is admin" do
- user = insert(:user, i
nfo: %{is_admin: true}
)
+ test "accepts a user that is a
n a
dmin" do
+ user = insert(:user, i
s_admin: true
)
- conn =
- build_conn()
- |> assign(:user, user)
+ conn = assign(build_conn(), :user, user)
- ret_conn =
- conn
- |> UserIsAdminPlug.call(%{})
+ ret_conn = UserIsAdminPlug.call(conn, %{})
assert conn == ret_conn
end
assert conn == ret_conn
end
- test "denies a user that isn't admin" do
+ test "denies a user that isn't a
n a
dmin" do
user = insert(:user)
conn =
user = insert(:user)
conn =
@@
-34,9
+30,7
@@
defmodule Pleroma.Plugs.UserIsAdminPlugTest do
end
test "denies when a user isn't set" do
end
test "denies when a user isn't set" do
- conn =
- build_conn()
- |> UserIsAdminPlug.call(%{})
+ conn = UserIsAdminPlug.call(build_conn(), %{})
assert conn.status == 403
end
assert conn.status == 403
end