gitlab-org--gitlab-foss/spec/workers/upload_checksum_worker_spec.rb
Grzegorz Bizon 73187801df Revert adding shared examples for every sidekiq worker
Since this already exists in `every_sidekiq_worker_spec.rb`.
2017-08-22 12:09:57 +02:00

19 lines
533 B
Ruby

require 'rails_helper'
describe UploadChecksumWorker do
describe '#perform' do
it 'rescues ActiveRecord::RecordNotFound' do
expect { described_class.new.perform(999_999) }.not_to raise_error
end
it 'calls calculate_checksum_without_delay and save!' do
upload = spy
expect(Upload).to receive(:find).with(999_999).and_return(upload)
described_class.new.perform(999_999)
expect(upload).to have_received(:calculate_checksum)
expect(upload).to have_received(:save!)
end
end
end