Sha256: 6ed8dd0239d778fa716317467f0d3577f080451adcba01a3013a687253b31d90
Contents?: true
Size: 799 Bytes
Versions: 7
Compression:
Stored size: 799 Bytes
Contents
require "rails_helper" describe ManifestationPolicy do subject { described_class } permissions :destroy? do before(:each) do @admin = FactoryBot.create(:admin) end it "grants destroy if it is a simple record." do record = FactoryBot.create(:manifestation) expect(subject).to permit(@admin, record) end it "not grants destroy if it is reserved" do record = FactoryBot.create(:manifestation) reserve = FactoryBot.create(:reserve, manifestation_id: record.id) expect(subject).not_to permit(@admin, record) end it "grants destroy if it is a simple serial record." do record = FactoryBot.create(:manifestation_serial) policy = Pundit.policy(@admin, record) expect(subject).to permit(@admin, record) end end end
Version data entries
7 entries across 7 versions & 1 rubygems