Remove ecto repo, add writing to file

This commit is contained in:
Maciej 2026-02-28 11:56:11 +02:00
parent 386a331956
commit ce463329f6
Signed by: maciej
GPG key ID: 28243AF437E32F99
20 changed files with 98 additions and 122 deletions

View file

@ -18,8 +18,6 @@ defmodule BirdyChat.DataCase do
using do
quote do
alias BirdyChat.Repo
import Ecto
import Ecto.Changeset
import Ecto.Query
@ -27,19 +25,10 @@ defmodule BirdyChat.DataCase do
end
end
setup tags do
BirdyChat.DataCase.setup_sandbox(tags)
setup _tags do
:ok
end
@doc """
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(BirdyChat.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
end
@doc """
A helper that transforms changeset errors into a map of messages.