From 6c7afefcbf4cb6cbaf587f86bae3ad489bda6271 Mon Sep 17 00:00:00 2001 From: Tsvetozar Penov Date: Wed, 29 Jan 2020 17:50:39 +0200 Subject: [PATCH] Fix dynamic through assertion for has_many through assoc (#3217) Since dynamic through assertion is not matched to query - it results in two same assertions and not testing the dynamic case. --- integration_test/cases/assoc.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/cases/assoc.exs b/integration_test/cases/assoc.exs index 0476a50bb5..511b091db6 100644 --- a/integration_test/cases/assoc.exs +++ b/integration_test/cases/assoc.exs @@ -71,7 +71,7 @@ defmodule Ecto.Integration.AssocTest do assert [^u2, ^u1] = TestRepo.all(query) # Dynamic through - Ecto.assoc([p1, p2], [:comments, :author]) |> order_by([a], a.name) + query = Ecto.assoc([p1, p2], [:comments, :author]) |> order_by([a], a.name) assert [^u2, ^u1] = TestRepo.all(query) end