Skip to content

Commit e29aa86

Browse files
authored
chore: fix bulk destroy tests (#290)
* chore: fix bulk destroy tests They were using an :update action * chore: fix credo error
1 parent 9b3e5d3 commit e29aa86

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/bulk_destroy_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ defmodule AshPostgres.BulkDestroyTest do
66
require Ash.Query
77

88
test "bulk destroys can run with nothing in the table" do
9-
Ash.bulk_destroy!(Post, :update, %{title: "new_title"})
9+
Ash.bulk_destroy!(Post, :destroy, %{})
1010
end
1111

1212
test "bulk destroys destroy everything pertaining to the query" do
1313
Ash.bulk_create!([%{title: "fred"}, %{title: "george"}], Post, :create)
1414

15-
Ash.bulk_destroy!(Post, :update, %{})
15+
Ash.bulk_destroy!(Post, :destroy, %{})
1616

1717
assert Ash.read!(Post) == []
1818
end
@@ -54,7 +54,7 @@ defmodule AshPostgres.BulkDestroyTest do
5454
Post
5555
|> Ash.Query.filter(author.first_name == "fred" or title == "fred")
5656
|> Ash.Query.select([:title])
57-
|> Ash.bulk_destroy!(:update, %{}, return_records?: true)
57+
|> Ash.bulk_destroy!(:destroy, %{}, return_records?: true)
5858

5959
assert [%{title: "george"}] = Ash.read!(Post)
6060
end

test/filter_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule AshPostgres.FilterTest do
22
use AshPostgres.RepoCase, async: false
33

4-
alias AshPostgres.Test.{Author, Comment, Post, Organization}
4+
alias AshPostgres.Test.{Author, Comment, Organization, Post}
55
alias AshPostgres.Test.ComplexCalculations.{Channel, ChannelMember}
66

77
require Ash.Query

0 commit comments

Comments
 (0)