Skip to content

Commit c20e752

Browse files
add tds test
1 parent 24bd53f commit c20e752

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

integration_test/tds/explain_test.exs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,19 @@ defmodule Ecto.Integration.ExplainTest do
3232
TestRepo.explain(:all, from(p in "posts", select: p.invalid, where: p.invalid == "title"))
3333
end)
3434
end
35+
36+
test "explain without rolling back" do
37+
TestRepo.insert!(%Post{})
38+
assert [%Post{}] = TestRepo.all(Post)
39+
40+
{:ok, {:ok, explain}} =
41+
TestRepo.transaction(fn ->
42+
TestRepo.explain(:delete_all, Post, analyze: true, rollback: false, timeout: 20000)
43+
end)
44+
45+
assert explain =~ "DELETE"
46+
assert explain =~ "p0"
47+
assert TestRepo.all(Post) == []
48+
end
3549
end
3650
end

0 commit comments

Comments
 (0)