diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-12 13:44:33 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-12 20:20:01 +0200 |
commit | 2461e10912b484c6942cd26f8fffd5c5557befa7 (patch) | |
tree | 0f4c604918ed24a2421bd427fbfcb74328c6fbaa /spec/workers/pipeline_hooks_worker_spec.rb | |
parent | 7c07c07d7a2b93ab81964b9cd28736652da1370a (diff) | |
download | gitlab-ce-2461e10912b484c6942cd26f8fffd5c5557befa7.tar.gz |
Execute pipeline hooks asynchronously
Diffstat (limited to 'spec/workers/pipeline_hooks_worker_spec.rb')
-rw-r--r-- | spec/workers/pipeline_hooks_worker_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/workers/pipeline_hooks_worker_spec.rb b/spec/workers/pipeline_hooks_worker_spec.rb new file mode 100644 index 00000000000..035e329839f --- /dev/null +++ b/spec/workers/pipeline_hooks_worker_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe PipelineHooksWorker do + describe '#perform' do + context 'when pipeline exists' do + let(:pipeline) { create(:ci_pipeline) } + + it 'executes hooks for the pipeline' do + expect_any_instance_of(Ci::Pipeline) + .to receive(:execute_hooks) + + described_class.new.perform(pipeline.id) + end + end + + context 'when pipeline does not exist' do + it 'does not raise exception' do + expect { described_class.new.perform(123) } + .not_to raise_error + end + end + end +end |