Assertions for your tests, whose failures say why (explain/3):
use Sekisho.Test, permissions: MyApp.Permissions
assert_allowed scope, :update, post
refute_allowed scope, :delete, post
assert_where_allowed Post, scope, :read, [published, mine]and a test that your policies are valid together:
test "the permissions are valid" do
assert MyApp.Permissions.validate!() == :ok
end
Summary
Functions
Asserts the scope has the permission on the resource.
Asserts where_allowed/3 gives exactly these records, in any order.
Asserts the scope does not have the permission on the resource.
Functions
Asserts the scope has the permission on the resource.
Asserts where_allowed/3 gives exactly these records, in any order.
Asserts the scope does not have the permission on the resource.