I’m on my learning curve of Phoenix and following the Phoenix For Rails developers book. It seems like it is a little bit outdated and the following line raises the error when running the test:
1) test orders process_order/3 creates an order (Storex.SalesTest)
test/storex/sales/sales_test.exs:132
** (FunctionClauseError) no function clause matching in Ecto.Multi.run/3
The following arguments were given to Ecto.Multi.run/3:
# 1
%Ecto.Multi{names: #MapSet<[]>, operations: []}
# 2
:order
# 3
#Function<3.77911555/1 in Storex.Sales.process_order/3>
Attempted function clauses (showing 1 out of 1):
def run(multi, name, run) when is_function(run, 2)
code: {:ok, order} = Sales.process_order(user, cart, %{address: "Test Street, 25"})
stacktrace:
(ecto) lib/ecto/multi.ex:436: Ecto.Multi.run/3
(storex) lib/storex/sales/sales.ex:68: Storex.Sales.process_order/3
test/storex/sales/sales_test.exs:139: (test)
Being in the very beginning of the learning, it is not really clear what the error says. Any idea?
I’m using:
- Elixir 1.9.1
- phoenix, “~> 1.4.10”
- phoenix_ecto, “~> 4.0”
- ecto_sql, “~> 3.1”
Thank you.