Sha256: 394520ec12e4eec495fd683bec4faa7263e40fdf67954b726952e07a79879e54

Contents?: true

Size: 576 Bytes

Versions: 34

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  it { is_expected.not_to be_readonly }

  describe "#readonly!" do
    it "makes the object readonly" do
      expect { subject.readonly! }.to change { subject.readonly? }.from(false).to(true)
    end
  end

  context "a readonly record" do
    before { subject.readonly! }

    it "does not be destroyable" do
      expect { subject.destroy }.to raise_error ActiveFedora::ReadOnlyRecord
    end

    it "does not be mutable" do
      expect { subject.save }.to raise_error ActiveFedora::ReadOnlyRecord
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/unit/readonly_spec.rb
active-fedora-9.7.3 spec/unit/readonly_spec.rb
active-fedora-10.3.0.rc2 spec/unit/readonly_spec.rb
active-fedora-10.3.0.rc1 spec/unit/readonly_spec.rb
active-fedora-10.2.1 spec/unit/readonly_spec.rb
active-fedora-10.2.0 spec/unit/readonly_spec.rb
active-fedora-11.0.0.rc1 spec/unit/readonly_spec.rb
active-fedora-10.1.0 spec/unit/readonly_spec.rb
active-fedora-10.1.0.rc1 spec/unit/readonly_spec.rb
active-fedora-9.7.2 spec/unit/readonly_spec.rb
active-fedora-10.0.0 spec/unit/readonly_spec.rb
active-fedora-10.0.0.beta4 spec/unit/readonly_spec.rb
active-fedora-10.0.0.beta3 spec/unit/readonly_spec.rb
active-fedora-10.0.0.beta2 spec/unit/readonly_spec.rb
active-fedora-10.0.0.beta1 spec/unit/readonly_spec.rb
active-fedora-9.13.0 spec/unit/readonly_spec.rb
active-fedora-9.12.0 spec/unit/readonly_spec.rb
active-fedora-9.11.0 spec/unit/readonly_spec.rb
active-fedora-9.10.4 spec/unit/readonly_spec.rb
active-fedora-9.10.3 spec/unit/readonly_spec.rb