X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fplugs%2Fuser_is_admin_plug_test.exs;h=8bc00e44497a58dafcdb48600fe07ca88880955f;hb=cc196e2cd57966889021342405ebc8fd0763e83a;hp=136dcc54ed2ce143873b1fce4a3c2bb885ad1fed;hpb=8cc809e44e3a899f93061c4c5f68d9736d79d79e;p=akkoma
diff --git a/test/plugs/user_is_admin_plug_test.exs b/test/plugs/user_is_admin_plug_test.exs
index 136dcc54e..8bc00e444 100644
--- 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
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# 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
- test "accepts a user that is admin" do
+ test "accepts a user that is an admin" do
user = insert(:user, is_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
- test "denies a user that isn't admin" do
+ test "denies a user that isn't an admin" do
user = insert(:user)
conn =
@@ -34,9 +30,7 @@ defmodule Pleroma.Plugs.UserIsAdminPlugTest 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