fix: ensure only the intended failing test fails (#1105)

It was making also other tests fail
This commit is contained in:
Riccardo Binetti 2024-05-03 01:15:26 +02:00 committed by GitHub
parent 0efa1a0a10
commit a3418e32ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -168,6 +168,10 @@ defmodule Ash.Test.Actions.BulkUpdateTest do
change set_context(%{authorize?: arg(:authorize?)})
end
update :update_with_match do
validate match(:title4, ~r/^[a-z]+$/)
end
end
identities do
@ -216,10 +220,6 @@ defmodule Ash.Test.Actions.BulkUpdateTest do
timestamps()
end
validations do
validate match(:title4, ~r/^[a-z]+$/)
end
end
test "returns updated records" do
@ -446,7 +446,7 @@ defmodule Ash.Test.Actions.BulkUpdateTest do
)
end
test "runs global validations with atomic_batches strategy" do
test "runs match validation with atomic_batches strategy" do
assert %Ash.BulkResult{
error_count: 1
} =
@ -458,7 +458,7 @@ defmodule Ash.Test.Actions.BulkUpdateTest do
|> Stream.map(fn {:ok, result} ->
result
end)
|> Ash.bulk_update(:update, %{title4: "INVALID"},
|> Ash.bulk_update(:update_with_match, %{title4: "INVALID"},
strategy: :atomic_batches,
resource: Post,
return_errors?: true,