mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
chore: format test
This commit is contained in:
parent
b13c7f0e53
commit
b7b2f586a1
1 changed files with 10 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue