ash_postgres/test/embeddable_resource_test.exs
Zach Daniel e8643d4aa0 fix: properly type cast top level fragments
chore: update tests not to use deprecated helper
2022-09-21 13:36:18 -04:00

21 lines
500 B
Elixir

defmodule AshPostgres.EmbeddableResourceTest do
@moduledoc false
use AshPostgres.RepoCase, async: false
alias AshPostgres.Test.{Api, Post}
require Ash.Query
setup do
post =
Post
|> Ash.Changeset.new(%{title: "title"})
|> Api.create!()
%{post: post}
end
test "calculations can load json", %{post: post} do
assert %{calc_returning_json: %AshPostgres.Test.Money{amount: 100, currency: :usd}} =
Api.load!(post, :calc_returning_json)
end
end