Sha256: ae21dfa2ddbee6973f4bfe5f8026b83b162de43fd46eddb5164b53df2c70328c
Contents?: true
Size: 967 Bytes
Versions: 3
Compression:
Stored size: 967 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 ActiveFedora::RelsExtDatastream.any_instance.stub(:dsChecksumValid).and_return(true) AuditJob.new(@file.pid, "RELS-EXT", @file.rels_ext.versionID).run @inbox = @user.mailbox.inbox @inbox.count.should == 0 end end describe "failing audit" do it "should send failing mail" do ActiveFedora::RelsExtDatastream.any_instance.stub(:dsChecksumValid).and_return(false) AuditJob.new(@file.pid, "RELS-EXT", @file.rels_ext.versionID).run @inbox = @user.mailbox.inbox @inbox.count.should == 1 @inbox.each { |msg| msg.last_message.subject.should == AuditJob::FAIL } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sufia-4.0.1 | spec/jobs/audit_job_spec.rb |
sufia-4.0.0 | spec/jobs/audit_job_spec.rb |
sufia-4.0.0.rc2 | spec/jobs/audit_job_spec.rb |