mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
22 lines
432 B
Elixir
22 lines
432 B
Elixir
defmodule Domain.CaseTemplate do
|
|
@moduledoc """
|
|
Our wrapper for the ExUnit.CaseTemplate to provide SQL sandbox helpers to all tests.
|
|
"""
|
|
use ExUnit.CaseTemplate
|
|
alias Ecto.Adapters.SQL.Sandbox
|
|
|
|
using do
|
|
quote do
|
|
setup tags do
|
|
:ok = Sandbox.checkout(Domain.Repo)
|
|
|
|
unless tags[:async] do
|
|
Sandbox.mode(Domain.Repo, {:shared, self()})
|
|
end
|
|
|
|
:ok
|
|
end
|
|
end
|
|
end
|
|
end
|