mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
test: Add test for strict_check
with filter policy (#387)
This commit is contained in:
parent
bc6daa56dd
commit
33a6438f00
1 changed files with 12 additions and 0 deletions
|
@ -27,6 +27,18 @@ defmodule Ash.Test.Policy.SimpleTest do
|
|||
end
|
||||
end
|
||||
|
||||
test "filter checks work on update/destroy actions", %{user: user} do
|
||||
tweet =
|
||||
Tweet
|
||||
|> Ash.Changeset.for_create(:create)
|
||||
|> Ash.Changeset.manage_relationship(:user, user, type: :append_and_remove)
|
||||
|> Api.create!()
|
||||
|
||||
changeset = Ash.Changeset.for_update(tweet, :update)
|
||||
|
||||
assert Ash.Policy.Info.strict_check(user, changeset, Api) == true
|
||||
end
|
||||
|
||||
test "non-filter checks work on create/update/destroy actions" do
|
||||
user = Api.create!(Ash.Changeset.new(User))
|
||||
|
||||
|
|
Loading…
Reference in a new issue