Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 3, 2024
1 parent 668feee commit e98669e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ash_money_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@ defmodule AshMoneyTest do
{Ash.Type.Decimal, []}
], {Ash.Type.Boolean, []}}
end

test "composite types can be accessed" do
assert {:ok, expr} =
expr(amount[:currency])
|> Ash.Filter.hydrate_refs(%{resource: ExampleResource})

assert {:ok, :USD} = eval(expr, record: %ExampleResource{amount: Money.new(0, :USD)})
end
end

0 comments on commit e98669e

Please sign in to comment.