ash_postgres/test/subquery_test.exs
2024-02-28 21:24:31 -05:00

18 lines
488 B
Elixir

defmodule AshPostgres.SubqueryTest do
use AshPostgres.RepoCase, async: false
alias AshPostgres.Test.Subquery.{Access, Child, Parent, Through}
test "joins are correctly wrapped in subqueries" do
{:ok, child} = Child.create(%{})
{:ok, parent} =
Parent.create(%{visible: true})
Access.create(%{parent_id: parent.id, email: "foo@bar.com"})
Through.create(%{parent_id: parent.id, child_id: child.id})
Child.read!(actor: %{email: "foo@bar.com"})
end
end