Sha256: 6ded4fcc42a55377cd48ca39a802ce1c890540b66c9d07da1cd354dca22d3652

Contents?: true

Size: 425 Bytes

Versions: 7

Compression:

Stored size: 425 Bytes

Contents

require "rails_helper"

describe ManifestationPolicy do
  subject { described_class }
  permissions :destroy? do
    before(:each) do
      @admin = FactoryBot.create(:admin)
    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
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enju_circulation-0.4.0.beta.4 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.4.0.beta.3 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.3.6 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.4.0.beta.2 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.4.0.beta.1 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.3.5 spec/policies/manifestation_policy_spec.rb
enju_circulation-0.3.4 spec/policies/manifestation_policy_spec.rb