You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The thing is that you are calling transaction/1 with a multi in your example. So you must stub/expect on transaction/1. transaction/2 will only be called when options are passed in. Ecto.Repo simply defaults to [] if the second argument is not passed.
The link you passed is the callback definition not the actual Repo definition:
Hi,
I had below code (got it from Phoenix tutorial) and I used Mimic to simulate Repo.transaction() result
If I mock
transaction/2
, I will get errorMyApp.Repo.transaction/2 to be invoked 1 time(s) but it has been called 0 time(s)
However, it works well if I try
transaction/1
insteadIs it desired behavior? I expect to mock
transaction
as arity of 2 which matches its definition.The text was updated successfully, but these errors were encountered: