gitlab-org--gitlab-foss/spec/workers/pipeline_notification_worker_spec.rb
Thong Kuah d6b952ad3e
Add frozen_string_literal to spec/workers
Adds `# frozen_string_literal: true` to spec/workers ruby files
2019-04-01 13:35:22 -03:00

21 lines
572 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe PipelineNotificationWorker, :mailer do
let(:pipeline) { create(:ci_pipeline) }
describe '#execute' do
it 'calls NotificationService#pipeline_finished when the pipeline exists' do
expect(NotificationService).to receive_message_chain(:new, :pipeline_finished)
subject.perform(pipeline.id)
end
it 'does nothing when the pipeline does not exist' do
expect(NotificationService).not_to receive(:new)
subject.perform(Ci::Pipeline.maximum(:id).to_i.succ)
end
end
end