Skip to content

Commit 53514b1

Browse files
committed
chore: fix tests
1 parent 9f9a209 commit 53514b1

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

test/support/resources/post.ex

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,16 @@ defmodule AshPostgres.Test.Post do
417417
end
418418

419419
update :review do
420-
change(after_action(fn changeset, record, _context ->
421-
new_model = {1.0, 2.0, 3.0}
420+
change(
421+
after_action(fn changeset, record, _context ->
422+
new_model = {1.0, 2.0, 3.0}
422423

423-
record
424-
|> Ash.Changeset.for_update(:atomic_update)
425-
|> Ash.Changeset.force_change_attribute(:model, new_model)
426-
|> Ash.update()
427-
end))
424+
record
425+
|> Ash.Changeset.for_update(:atomic_update)
426+
|> Ash.Changeset.force_change_attribute(:model, new_model)
427+
|> Ash.update()
428+
end)
429+
)
428430

429431
require_atomic?(false)
430432
end
@@ -525,15 +527,16 @@ defmodule AshPostgres.Test.Post do
525527
attribute(:uniq_if_contains_foo, :string, public?: true)
526528

527529
attribute :model, :tuple do
528-
constraints [
530+
constraints(
529531
fields: [
530532
alpha: [type: :float, description: "The alpha field"],
531533
beta: [type: :float, description: "The beta field"],
532534
t: [type: :float, description: "The t field"]
533535
]
534-
]
535-
allow_nil? false
536-
default fn -> {3.0, 3.0, 1.0} end
536+
)
537+
538+
allow_nil?(false)
539+
default(fn -> {3.0, 3.0, 1.0} end)
537540
end
538541

539542
attribute :list_containing_nils, {:array, :string} do

test/support/resources/post_with_empty_update.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,18 @@ defmodule AshPostgres.Test.PostWithEmptyUpdate do
3737
public?(true)
3838
source(:title_column)
3939
end
40+
41+
attribute :model, :tuple do
42+
constraints(
43+
fields: [
44+
alpha: [type: :float, description: "The alpha field"],
45+
beta: [type: :float, description: "The beta field"],
46+
t: [type: :float, description: "The t field"]
47+
]
48+
)
49+
50+
allow_nil?(false)
51+
default(fn -> {3.0, 3.0, 1.0} end)
52+
end
4053
end
4154
end

0 commit comments

Comments
 (0)