Skip to content

Commit

Permalink
test: Show lack of calculations coming back (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodeoclash authored Aug 30, 2023
1 parent 881900f commit 91ee219
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/acceptance/post_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ defmodule Test.Acceptance.PostTest do
base("/posts")
get(:read)
index(:read)
post(:create, relationship_arguments: [:author])

#post(:create, relationship_arguments: [:author])
post(:create, relationship_arguments: [:author], default_fields: [:name, :email, :hidden, :name_twice])

post(:accepts_email,
upsert?: true,
Expand Down Expand Up @@ -108,6 +110,10 @@ defmodule Test.Acceptance.PostTest do
relationships do
belongs_to(:author, Test.Acceptance.PostTest.Author, allow_nil?: true)
end

calculations do
calculate(:name_twice, :string, concat([:name, :name], "-"))
end
end

defmodule Registry do
Expand Down Expand Up @@ -179,7 +185,9 @@ defmodule Test.Acceptance.PostTest do
}
}
})
|> IO.inspect
|> assert_attribute_equals("email", nil)
|> assert_attribute_equals("name_twice", "Post 1-Post 1")
end
end

Expand Down

0 comments on commit 91ee219

Please sign in to comment.