-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Make it possible to test a projector by directly calling a function on the projector module, passing an Ecto.Multi
struct, an event, and its metadata.
Examples
Test a projector by projecting a single event:
{:ok, _changes} =
Ecto.Multi.new()
|> MyApp.ExampleProjector.project(event, metadata)
|> MyApp.Repo.transaction()
Test a projector by reducing a list of events:
multi =
Enum.reduce(events, Ecto.Multi.new(), fn event, multi ->
MyApp.ExampleProjector.project(multi, event, metadata)
end)
{:ok, _changes} = MyApp.Repo.transaction(multi)
PaoloLaurenti, AlphaHydrae, Cantido, edmaarcosta, antoinereyt and 6 moreanderslemke
Metadata
Metadata
Assignees
Labels
No labels