projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'issue/sign-authority' into 'develop'
[akkoma]
/
test
/
plugs
/
user_enabled_plug_test.exs
diff --git
a/test/plugs/user_enabled_plug_test.exs
b/test/plugs/user_enabled_plug_test.exs
index e85b37ffee655938c4710e08a2670d4164fcb990..b219d8abffa35f759470dccedbefbba9ceddb7f6 100644
(file)
--- a/
test/plugs/user_enabled_plug_test.exs
+++ b/
test/plugs/user_enabled_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.UserEnabledPlugTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserEnabledPlugTest do
@@
-8,6
+8,8
@@
defmodule Pleroma.Plugs.UserEnabledPlugTest do
alias Pleroma.Plugs.UserEnabledPlug
import Pleroma.Factory
alias Pleroma.Plugs.UserEnabledPlug
import Pleroma.Factory
+ setup do: clear_config([:instance, :account_activation_required])
+
test "doesn't do anything if the user isn't set", %{conn: conn} do
ret_conn =
conn
test "doesn't do anything if the user isn't set", %{conn: conn} do
ret_conn =
conn
@@
-18,10
+20,9
@@
defmodule Pleroma.Plugs.UserEnabledPlugTest do
test "with a user that's not confirmed and a config requiring confirmation, it removes that user",
%{conn: conn} do
test "with a user that's not confirmed and a config requiring confirmation, it removes that user",
%{conn: conn} do
- old = Pleroma.Config.get([:instance, :account_activation_required])
Pleroma.Config.put([:instance, :account_activation_required], true)
Pleroma.Config.put([:instance, :account_activation_required], true)
- user = insert(:user,
info: %{confirmation_pending: true}
)
+ user = insert(:user,
confirmation_pending: true
)
conn =
conn
conn =
conn
@@
-29,12
+30,10
@@
defmodule Pleroma.Plugs.UserEnabledPlugTest do
|> UserEnabledPlug.call(%{})
assert conn.assigns.user == nil
|> UserEnabledPlug.call(%{})
assert conn.assigns.user == nil
-
- Pleroma.Config.put([:instance, :account_activation_required], old)
end
test "with a user that is deactivated, it removes that user", %{conn: conn} do
end
test "with a user that is deactivated, it removes that user", %{conn: conn} do
- user = insert(:user,
info: %{deactivated: true}
)
+ user = insert(:user,
deactivated: true
)
conn =
conn
conn =
conn