|
|
@ -87,14 +87,14 @@ describe ExtractFulltextJob, type: :job do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context 'with exception in extraction' do |
|
|
|
context 'with exception in extraction' do |
|
|
|
let(:exception_message) { 'boom' } |
|
|
|
let(:exception_message) { 'boom-internal-error' } |
|
|
|
let(:logger) { Rails.logger } |
|
|
|
let(:logger) { Rails.logger } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
allow_any_instance_of(Plaintext::Resolver).to receive(:text).and_raise(exception_message) |
|
|
|
allow_any_instance_of(Plaintext::Resolver).to receive(:text).and_raise(exception_message) |
|
|
|
|
|
|
|
|
|
|
|
# This line is actually part of the test. `expect` call needs to go so far up here, as we want to verify that a message gets logged. |
|
|
|
# This line is actually part of the test. `expect` call needs to go so far up here, as we want to verify that a message gets logged. |
|
|
|
expect(logger).to receive(:error).with(exception_message) |
|
|
|
expect(logger).to receive(:error).with(/boom-internal-error/) |
|
|
|
|
|
|
|
|
|
|
|
allow(attachment).to receive(:readable?).and_return(true) |
|
|
|
allow(attachment).to receive(:readable?).and_return(true) |
|
|
|
attachment.reload |
|
|
|
attachment.reload |
|
|
|