Sha256: 0af152c2451e857f719cf6550ad5aeb7cffdfe2e249f38a919bf2012dc2ce46a

Contents?: true

Size: 579 Bytes

Versions: 16

Compression:

Stored size: 579 Bytes

Contents

describe Sufia::ImportUrlFailureService do
  let!(:depositor) { create(:user) }
  let(:inbox) { depositor.mailbox.inbox }
  let(:file) do
    FileSet.create do |file|
      file.apply_depositor_metadata(depositor)
    end
  end

  before do
    allow(file.errors).to receive(:full_messages).and_return(['huge mistake'])
  end

  describe "#call" do
    before do
      described_class.new(file, depositor).call
    end

    it "sends failing mail" do
      expect(inbox.count).to eq(1)
      expect(inbox.first.last_message.subject).to eq('File Import Error')
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sufia-7.4.1 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.4.0 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.3.1 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.3.0 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.3.0.rc3 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.3.0.rc2 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.3.0.rc1 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.2.0 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.1.0 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.rc2 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.rc1 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.beta4 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.beta3 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.beta2 spec/services/sufia/import_url_failure_service_spec.rb
sufia-7.0.0.beta1 spec/services/sufia/import_url_failure_service_spec.rb