@@ -3,6 +3,7 @@ defmodule AshPostgres.AtomicsTest do
3
3
alias AshPostgres.Test.Comment
4
4
5
5
use AshPostgres.RepoCase , async: false
6
+
6
7
alias AshPostgres.Test.Invite
7
8
alias AshPostgres.Test.Post
8
9
alias AshPostgres.Test.User
@@ -367,29 +368,29 @@ defmodule AshPostgres.AtomicsTest do
367
368
|> Ash . update! ( )
368
369
end
369
370
370
- # assert_raise Ash.Error.Invalid, ~r/Can only update if Post has no comments/, fn ->
371
- # post
372
- # |> Ash.Changeset.new()
373
- # |> Ash.Changeset.put_context(:aggregate, unquote(aggregate))
374
- # |> Ash.Changeset.for_update(:update_if_no_comments_non_atomic, %{title: "bar"})
375
- # |> Ash.update!()
376
- # end
377
-
378
- # assert_raise Ash.Error.Invalid, ~r/Can only delete if Post has no comments/, fn ->
379
- # post
380
- # |> Ash.Changeset.new()
381
- # |> Ash.Changeset.put_context(:aggregate, unquote(aggregate))
382
- # |> Ash.Changeset.for_destroy(:destroy_if_no_comments_non_atomic, %{})
383
- # |> Ash.destroy!()
384
- # end
385
-
386
- # assert_raise Ash.Error.Invalid, ~r/Can only delete if Post has no comments/, fn ->
387
- # post
388
- # |> Ash.Changeset.new()
389
- # |> Ash.Changeset.put_context(:aggregate, unquote(aggregate))
390
- # |> Ash.Changeset.for_destroy(:destroy_if_no_comments, %{})
391
- # |> Ash.destroy!()
392
- # end
371
+ assert_raise Ash.Error.Invalid , ~r/ Can only update if Post has no comments/ , fn ->
372
+ post
373
+ |> Ash.Changeset . new ( )
374
+ |> Ash.Changeset . put_context ( :aggregate , unquote ( aggregate ) )
375
+ |> Ash.Changeset . for_update ( :update_if_no_comments_non_atomic , % { title: "bar" } )
376
+ |> Ash . update! ( )
377
+ end
378
+
379
+ assert_raise Ash.Error.Invalid , ~r/ Can only delete if Post has no comments/ , fn ->
380
+ post
381
+ |> Ash.Changeset . new ( )
382
+ |> Ash.Changeset . put_context ( :aggregate , unquote ( aggregate ) )
383
+ |> Ash.Changeset . for_destroy ( :destroy_if_no_comments_non_atomic , % { } )
384
+ |> Ash . destroy! ( )
385
+ end
386
+
387
+ assert_raise Ash.Error.Invalid , ~r/ Can only delete if Post has no comments/ , fn ->
388
+ post
389
+ |> Ash.Changeset . new ( )
390
+ |> Ash.Changeset . put_context ( :aggregate , unquote ( aggregate ) )
391
+ |> Ash.Changeset . for_destroy ( :destroy_if_no_comments , % { } )
392
+ |> Ash . destroy! ( )
393
+ end
393
394
end
394
395
end
395
396
)
0 commit comments