Sha256: 573e82e843a50fa9f656add71d6089de26bd81f341bb5fa456b950310b984051

Contents?: true

Size: 1011 Bytes

Versions: 12

Compression:

Stored size: 1011 Bytes

Contents

RSpec.shared_examples "a DDR model" do

  it_behaves_like "a describable object"
  it_behaves_like "a governable object"
  it_behaves_like "a licensable object"
  it_behaves_like "an access controllable object"
  it_behaves_like "an object that has properties"
  it_behaves_like "an object that has a display title"
  it_behaves_like "an object that has identifiers"

  describe "events" do
    describe "on deletion with #destroy" do
      before { subject.save(validate: false) }
      it "should create a deletion event" do
        expect { subject.destroy }.to change { Ddr::Events::DeletionEvent.for_object(subject).count }.from(0).to(1)
      end
    end

    describe "last virus check" do
      let!(:fixity_check) { Ddr::Events::FixityCheckEvent.new }
      before { allow(subject).to receive(:last_fixity_check) { fixity_check } }
      its(:last_fixity_check_on) { should eq(fixity_check.event_date_time) }
      its(:last_fixity_check_outcome) { should eq(fixity_check.outcome) }
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddr-models-2.0.0 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc6 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc5 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc4 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc3 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc2 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.rc1 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.pre.5 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.pre.4 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.pre.3 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.pre.2 spec/support/shared_examples_for_ddr_models.rb
ddr-models-2.0.0.pre.1 spec/support/shared_examples_for_ddr_models.rb