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
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue