Sha256: 28b711f9ba9c3bf1a694dfa26edf1ec04a3676bb36544f616e4e93fdb59f5a49

Contents?: true

Size: 1.01 KB

Versions: 11

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe ActiveFedora::Persistence do
  context "internal methods" do
    before :all do
      class SpecNode
        include ActiveFedora::Persistence
      end
    end
    after :all do
      Object.send(:remove_const, :SpecNode)
    end

    subject { SpecNode.new }

    describe "#create_needs_index?" do
      it "should be true" do
        subject.send(:create_needs_index?).should be_true
      end
    end

    describe "#update_needs_index?" do
      it "should be true" do
        subject.send(:update_needs_index?).should be_true
      end
    end
  end

  describe "an unsaved object" do
    subject { ActiveFedora::Base.new }
    it "should be deleteable (nop) and return the object" do
      expect(subject.delete).to eq subject
    end
  end

  describe "a saved object" do
    subject { ActiveFedora::Base.create! }
    describe "that is deleted" do
      before do
        subject.delete
      end
      it "should be frozen" do
        expect(subject).to be_frozen
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active-fedora-7.0.4 spec/unit/persistence_spec.rb
active-fedora-7.0.3 spec/unit/persistence_spec.rb
active-fedora-7.0.2 spec/unit/persistence_spec.rb
active-fedora-7.0.1 spec/unit/persistence_spec.rb
active-fedora-7.0.0 spec/unit/persistence_spec.rb
active-fedora-7.0.0.rc3 spec/unit/persistence_spec.rb
active-fedora-7.0.0.rc2 spec/unit/persistence_spec.rb
active-fedora-7.0.0.rc1 spec/unit/persistence_spec.rb
active-fedora-7.0.0.pre3 spec/unit/persistence_spec.rb
active-fedora-7.0.0.pre2 spec/unit/persistence_spec.rb
active-fedora-7.0.0.pre1 spec/unit/persistence_spec.rb