Fix test flakiness due to shared state in asynchronous run (#3184)
* Fix flaky test * Prevent this in the futurepull/3182/head^2
parent
b606fc1809
commit
928691158f
@ -0,0 +1,18 @@
|
||||
defmodule PlausibleWeb.Api.InternalController.SyncTest do
|
||||
use PlausibleWeb.ConnCase, async: false
|
||||
use Plausible.Repo
|
||||
|
||||
describe "PUT /api/:domain/disable-feature" do
|
||||
setup [:create_user, :log_in]
|
||||
|
||||
test "when the logged-in user is an super-admin", %{conn: conn, user: user} do
|
||||
site = insert(:site)
|
||||
patch_env(:super_admin_user_ids, [user.id])
|
||||
|
||||
conn = put(conn, "/api/#{site.domain}/disable-feature", %{"feature" => "conversions"})
|
||||
|
||||
assert json_response(conn, 200) == "ok"
|
||||
assert %{conversions_enabled: false} = Plausible.Sites.get_by_domain(site.domain)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue