Closed SergeyKorochansky closed 8 years ago
Having the same issue ;/
Using ecto-2.0.0-rc.3 and phoenix-ecto-3.0.0-rc.0 it seems to be working.
I added to the bottom of spec/phoenix_helper.exs:
Ecto.Adapters.SQL.Sandbox.mode( App.Repo, :manual )
And in spec/spec_helper.exs:
config.before fn ->
:ok = Ecto.Adapters.SQL.Sandbox.checkout( App.Repo )
{:shared, hello: :world}
end
config.finally fn(_shared) ->
:ok = Ecto.Adapters.SQL.Sandbox.checkin( App.Repo )
:ok
end
Seems to be working for me.
@sriedel worked for me too, thanks.
@sriedel thanks for the solution!
@sriedel your fix did the trick for me as well. Thanks!
@antonmi I updated ecto to the last version and my espec tests are red now :fearful: As said in Ecto changelog, I replaced
begin_test_transaction
withEcto.Adapters.SQL.Sandbox.mode(FishDuel.Repo, :manual)
andrestart_test_transaction
with:ok = Ecto.Adapters.SQL.Sandbox.checkout(FishDuel.Repo)
, but still recieve this error: