summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-13 12:45:16 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-13 12:45:16 +0200
commitfafc5a1777484ba6b1b12c5e88f3fc783fb4d839 (patch)
tree961264587ff7dd930eb503589cf8bc4ed0caacf5 /spec
parent2461e10912b484c6942cd26f8fffd5c5557befa7 (diff)
downloadgitlab-ce-fafc5a1777484ba6b1b12c5e88f3fc783fb4d839.tar.gz
Perform CI build hooks asynchronously using worker
Diffstat (limited to 'spec')
-rw-r--r--spec/workers/build_hooks_worker_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/workers/build_hooks_worker_spec.rb b/spec/workers/build_hooks_worker_spec.rb
new file mode 100644
index 00000000000..97654a93f5c
--- /dev/null
+++ b/spec/workers/build_hooks_worker_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe BuildHooksWorker do
+ describe '#perform' do
+ context 'when build exists' do
+ let!(:build) { create(:ci_build) }
+
+ it 'calls build hooks' do
+ expect_any_instance_of(Ci::Build)
+ .to receive(:execute_hooks)
+
+ described_class.new.perform(build.id)
+ end
+ end
+
+ context 'when build does not exist' do
+ it 'does not raise exception' do
+ expect { described_class.new.perform(123) }
+ .not_to raise_error
+ end
+ end
+ end
+end