diff --git a/spec/pundit_spec.rb b/spec/pundit_spec.rb index f38ca8e..6d64054 100644 --- a/spec/pundit_spec.rb +++ b/spec/pundit_spec.rb @@ -22,6 +22,10 @@ describe Pundit do expect(Pundit.authorize(user, post, :update?)).to be_truthy end + it "can be given a different policy class" do + expect(Pundit.authorize(user, post, :create?, policy_class: PublicationPolicy)).to be_truthy + end + it "works with anonymous class policies" do expect(Pundit.authorize(user, article_tag, :show?)).to be_truthy expect { Pundit.authorize(user, article_tag, :destroy?) }.to raise_error(Pundit::NotAuthorizedError)