mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
test: add test for filter policy on bulk actions
This commit is contained in:
parent
7a4fe87561
commit
256b4d0b9a
3 changed files with 10 additions and 3 deletions
2
mix.exs
2
mix.exs
|
@ -158,7 +158,7 @@ defmodule AshPostgres.MixProject do
|
|||
{:jason, "~> 1.0"},
|
||||
{:postgrex, ">= 0.0.0"},
|
||||
{:ash,
|
||||
ash_version(github: "ash-project/ash", ref: "f23f0a29fec8a231e3fbff64034be8c9efb87e73")},
|
||||
ash_version(github: "ash-project/ash", ref: "dcbccec7c36e2cad9d8366fa797b617e043b7b28")},
|
||||
{:benchee, "~> 1.1", only: [:dev, :test]},
|
||||
{:git_ops, "~> 2.5", only: [:dev, :test]},
|
||||
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
|
||||
|
|
|
@ -18,9 +18,16 @@ defmodule AshPostgresTest do
|
|||
|> Ash.Changeset.new(%{title: "good"})
|
||||
|> AshPostgres.Test.Api.create!()
|
||||
|
||||
assert_raise Ash.Error.Forbidden, fn ->
|
||||
post
|
||||
|> Ash.Changeset.for_update(:update, %{title: "bad"}, authorize?: true)
|
||||
|> AshPostgres.Test.Api.update!()
|
||||
|> Map.get(:title)
|
||||
end
|
||||
|
||||
post
|
||||
|> Ash.Changeset.for_update(:update, %{title: "okay"}, authorize?: true)
|
||||
|> AshPostgres.Test.Api.update!()
|
||||
|> Map.get(:title)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
defmodule FilterFieldPolicyTest do
|
||||
use AshPostgres.RepoCase, async: false
|
||||
|
||||
alias AshPostgres.Test.{Api, Post, Organization, User}
|
||||
alias AshPostgres.Test.{Api, Organization, Post, User}
|
||||
|
||||
require Ash.Query
|
||||
|
||||
|
|
Loading…
Reference in a new issue