Sha256: 3d51004770041567f744eb94fabcaaeb1f3ac06307166aa710ee1cf5e6a880d7
Contents?: true
Size: 544 Bytes
Versions: 1
Compression:
Stored size: 544 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe PostPolicy do let(:user) { double } let(:own_post) { double(user: user) } let(:other_post) { double(user: double) } subject { described_class } permissions :update?, :show? do it "is successful when all permissions match" do should permit(user, own_post) end it "fails when any permissions do not match" do expect do should permit(user, other_post) end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pundit-2.1.0 | spec/policies/post_policy_spec.rb |