mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
test: add test for bugfix in ash
This commit is contained in:
parent
c104e6a2ba
commit
06c0c328df
1 changed files with 12 additions and 1 deletions
|
@ -106,6 +106,8 @@ defmodule AshPostgres.BulkUpdateTest do
|
|||
test "bulk updates honor update action filters when streaming" do
|
||||
Ash.bulk_create!([%{title: "fred"}, %{title: "george"}], Post, :create)
|
||||
|
||||
Logger.configure(level: :debug)
|
||||
|
||||
Post
|
||||
|> Ash.bulk_update!(:update_only_freds, %{},
|
||||
strategy: :stream,
|
||||
|
@ -113,9 +115,18 @@ defmodule AshPostgres.BulkUpdateTest do
|
|||
atomic_update: %{title: Ash.Expr.expr(title <> "_stuff")}
|
||||
)
|
||||
|
||||
titles =
|
||||
posts =
|
||||
Post
|
||||
|> Ash.read!()
|
||||
|
||||
fred =
|
||||
posts
|
||||
|> Enum.find(&(&1.title == "fred_stuff"))
|
||||
|
||||
assert fred.created_at != fred.updated_at
|
||||
|
||||
titles =
|
||||
posts
|
||||
|> Enum.map(& &1.title)
|
||||
|> Enum.sort()
|
||||
|
||||
|
|
Loading…
Reference in a new issue