Sha256: 9786c796256dd9107fcddfba7d4c2d2848f7ff3d842d9a6e3dd19fd1c260c8e0
Contents?: true
Size: 1014 Bytes
Versions: 5
Compression:
Stored size: 1014 Bytes
Contents
require 'spec_helper' describe AuditJob do before do @user = FactoryGirl.find_or_create(:jill) @inbox = @user.mailbox.inbox @file = GenericFile.new @file.apply_depositor_metadata(@user) @file.save end after do @file.delete end describe "passing audit" do it "should not send passing mail" do allow_any_instance_of(ActiveFedora::RelsExtDatastream).to receive(:dsChecksumValid).and_return(true) AuditJob.new(@file.pid, "RELS-EXT", @file.rels_ext.versionID).run @inbox = @user.mailbox.inbox expect(@inbox.count).to eq(0) end end describe "failing audit" do it "should send failing mail" do allow_any_instance_of(ActiveFedora::RelsExtDatastream).to receive(:dsChecksumValid).and_return(false) AuditJob.new(@file.pid, "RELS-EXT", @file.rels_ext.versionID).run @inbox = @user.mailbox.inbox expect(@inbox.count).to eq(1) @inbox.each { |msg| expect(msg.last_message.subject).to eq(AuditJob::FAIL) } end end end
Version data entries
5 entries across 5 versions & 1 rubygems