Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test helpers for policies to test for actions and actions on objects #33

Open
rreinhardt9 opened this issue Sep 4, 2019 · 0 comments

Comments

@rreinhardt9
Copy link
Contributor

It would be really helpful to have a quick way to test that a policy implements given actions or actions on objects. Currently we have to do something like:

    it "has the expected actions" do
      user = build(:user)
      policy = AccessControl::RolePolicy.new(user)
      expect(policy).to respond_to(:create_edit_roles?, :manage?)
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant