summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-08 12:54:23 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-08 12:54:23 +0000
commit11ff9fc6a9837cd5defa0325b5057a5a3d84634c (patch)
tree0eb9d8123e50afd8ed4ddd0fef2c82d2cbf446fd /spec/workers
parent1d0aa4806fb3d7a793e7bc4eac50032a8e3c53d7 (diff)
parent29519edb55f17d0e7de5dfb289085c894b4d2826 (diff)
downloadgitlab-ce-11ff9fc6a9837cd5defa0325b5057a5a3d84634c.tar.gz
Merge branch '28359-skip-process-commit-worker-unless-issues-referenced' into 'master' 31977-ensure-all-webpack-bundles-which-include-vue-are-children-of-common_vue-js
Use regex to skip unnecessary reference processing in ProcessCommitWorker Closes #28359 See merge request !10867
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/process_commit_worker_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/workers/process_commit_worker_spec.rb b/spec/workers/process_commit_worker_spec.rb
index 9afe2e610b9..6295856b461 100644
--- a/spec/workers/process_commit_worker_spec.rb
+++ b/spec/workers/process_commit_worker_spec.rb
@@ -20,6 +20,14 @@ describe ProcessCommitWorker do
worker.perform(project.id, -1, commit.to_hash)
end
+ it 'does not process the commit when no issues are referenced' do
+ allow(worker).to receive(:build_commit).and_return(double(matches_cross_reference_regex?: false))
+
+ expect(worker).not_to receive(:process_commit_message)
+
+ worker.perform(project.id, user.id, commit.to_hash)
+ end
+
it 'processes the commit message' do
expect(worker).to receive(:process_commit_message).and_call_original