fix tests

This commit is contained in:
2022-01-22 20:44:38 -05:00
committed by oliviasculley
parent a64d92a6cf
commit 728728a5a4
17 changed files with 57 additions and 10 deletions

View File

@ -16,6 +16,7 @@ defmodule LokalWeb.ChannelCase do
"""
use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox
using do
quote do
@ -29,8 +30,8 @@ defmodule LokalWeb.ChannelCase do
end
setup tags do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
:ok
end
end

View File

@ -16,6 +16,7 @@ defmodule LokalWeb.ConnCase do
"""
use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox
using do
quote do
@ -32,8 +33,8 @@ defmodule LokalWeb.ConnCase do
end
setup tags do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
{:ok, conn: Phoenix.ConnTest.build_conn()}
end

View File

@ -15,6 +15,7 @@ defmodule Lokal.DataCase do
"""
use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox
using do
quote do
@ -28,8 +29,8 @@ defmodule Lokal.DataCase do
end
setup tags do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
:ok
end