Remove ecto repo, add writing to file
This commit is contained in:
parent
386a331956
commit
ce463329f6
20 changed files with 98 additions and 122 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue