Improved in-test clear_config/n applicability (setup / setup_all / in-test usage).
This commit is contained in:
parent
0e27c274f4
commit
1c05f539aa
84 changed files with 196 additions and 298 deletions
|
|
@ -17,11 +17,10 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do
|
|||
:ok
|
||||
end
|
||||
|
||||
clear_config_all([:instance, :federating], true)
|
||||
|
||||
clear_config([:instance])
|
||||
clear_config([:frontend_configurations, :pleroma_fe])
|
||||
clear_config([:user, :deny_follow_blocked])
|
||||
setup_all do: clear_config([:instance, :federating], true)
|
||||
setup do: clear_config([:instance])
|
||||
setup do: clear_config([:frontend_configurations, :pleroma_fe])
|
||||
setup do: clear_config([:user, :deny_follow_blocked])
|
||||
|
||||
describe "GET /ostatus_subscribe - remote_follow/2" do
|
||||
test "adds status to pleroma instance if the `acct` is a status", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
end
|
||||
|
||||
describe "register with one time token" do
|
||||
clear_config([:instance, :registrations_open], false)
|
||||
setup do: clear_config([:instance, :registrations_open], false)
|
||||
|
||||
test "returns user on success" do
|
||||
{:ok, invite} = UserInviteToken.create_invite()
|
||||
|
|
@ -182,7 +182,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
end
|
||||
|
||||
describe "registers with date limited token" do
|
||||
clear_config([:instance, :registrations_open], false)
|
||||
setup do: clear_config([:instance, :registrations_open], false)
|
||||
|
||||
setup do
|
||||
data = %{
|
||||
|
|
@ -242,7 +242,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
end
|
||||
|
||||
describe "registers with reusable token" do
|
||||
clear_config([:instance, :registrations_open], false)
|
||||
setup do: clear_config([:instance, :registrations_open], false)
|
||||
|
||||
test "returns user on success, after him registration fails" do
|
||||
{:ok, invite} = UserInviteToken.create_invite(%{max_use: 100})
|
||||
|
|
@ -286,7 +286,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
end
|
||||
|
||||
describe "registers with reusable date limited token" do
|
||||
clear_config([:instance, :registrations_open], false)
|
||||
setup do: clear_config([:instance, :registrations_open], false)
|
||||
|
||||
test "returns user on success" do
|
||||
{:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
|||
:ok
|
||||
end
|
||||
|
||||
clear_config([:instance])
|
||||
clear_config([:frontend_configurations, :pleroma_fe])
|
||||
setup do: clear_config([:instance])
|
||||
setup do: clear_config([:frontend_configurations, :pleroma_fe])
|
||||
|
||||
describe "POST /api/pleroma/follow_import" do
|
||||
setup do: oauth_access(["follow"])
|
||||
|
|
@ -318,7 +318,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
|||
end
|
||||
|
||||
describe "GET /api/pleroma/healthcheck" do
|
||||
clear_config([:instance, :healthcheck])
|
||||
setup do: clear_config([:instance, :healthcheck])
|
||||
|
||||
test "returns 503 when healthcheck disabled", %{conn: conn} do
|
||||
Config.put([:instance, :healthcheck], false)
|
||||
|
|
@ -427,7 +427,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
|||
end
|
||||
|
||||
describe "POST /main/ostatus - remote_subscribe/2" do
|
||||
clear_config([:instance, :federating], true)
|
||||
setup do: clear_config([:instance, :federating], true)
|
||||
|
||||
test "renders subscribe form", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue