I follow this tutorial and after adding this code and the Factory role, I get the following errors:
15: 09: 08.808 [error] GenServer # PID <0.245.0> completion ** (UndefinedFunctionError) Ecto.Adapters.SQL.begin_test_transaction / 1 is undefined or closed. Did you mean one of:
* in_transaction?/1
(ecto) Ecto.Adapters.SQL.begin_test_transaction(Pxblog.Repo)
(elixir) src/elixir_compiler.erl:125: :elixir_compiler.dispatch_loaded/6
(elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:30: :elixir_compiler.quoted/3
(elixir) lib/code.ex:363: Code.require_file/2
(elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:651: Enum.each/2
(mix) lib/mix/tasks/test.ex:216: Mix.Tasks.Test.run/1
Here is my test_helper.exs file :
{:ok, _} = Application.ensure_all_started(:ex_machina)
ExUnit.start
Mix.Task.run "ecto.create", ~w(-r Pxblog.Repo --quiet)
Mix.Task.run "ecto.migrate", ~w(-r Pxblog.Repo --quiet)
Ecto.Adapters.SQL.begin_test_transaction(Pxblog.Repo)
What could be wrong? I have already updated all the dependencies with . mix deps.update --all
Thanks in advance!
source
share