chore: format test

This commit is contained in:
Zach Daniel 2023-09-22 17:05:07 -04:00
parent b13c7f0e53
commit b7b2f586a1

View file

@ -138,25 +138,27 @@ defmodule Ash.Test.Actions.ReadTest do
describe "around_transaction/2" do
test "it runs around the action" do
Post
|> new(%{title: "test", contents: "yeet"})
|> Api.create!()
|> strip_metadata()
Post
|> new(%{title: "test", contents: "yeet"})
|> Api.create!()
|> strip_metadata()
assert {:ok, [_]} =
Post
|> Ash.Query.around_transaction(fn query, callback ->
send(self(), :around_transaction_start)
{:ok, results} = callback.(query)
{:ok, results} = callback.(query)
send(self(), :around_transaction_end)
{:ok, results}
end)
end)
|> Ash.Query.before_action(fn query ->
send(self(), :before_action)
query
end)
end)
|> Api.read()
assert {:messages, [:around_transaction_start, :before_action, :around_transaction_end]} = :erlang.process_info(self(), :messages)
assert {:messages, [:around_transaction_start, :before_action, :around_transaction_end]} =
:erlang.process_info(self(), :messages)
end
end