Sha256: 7530ef3839692aa4d5fb1e792e954e64c727763cf872c021c70a24111e68da73

Contents?: true

Size: 917 Bytes

Versions: 5

Compression:

Stored size: 917 Bytes

Contents

RSpec.shared_examples "a DDR model" do

  it_behaves_like "a describable object"
  it_behaves_like "a governable object"
  it_behaves_like "an object that has a display title"
  it_behaves_like "an object that has identifiers"
  it_behaves_like "a fixity checkable object"

  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

5 entries across 5 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.7 spec/support/shared_examples_for_ddr_models.rb
ddr-models-3.0.0.beta.6 spec/support/shared_examples_for_ddr_models.rb
ddr-models-3.0.0.beta.4 spec/support/shared_examples_for_ddr_models.rb
ddr-models-3.0.0.beta.3 spec/support/shared_examples_for_ddr_models.rb
ddr-models-3.0.0.beta.2 spec/support/shared_examples_for_ddr_models.rb