diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-22 05:26:58 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-05-04 22:03:46 +0300 |
commit | 020295fffc2329b7852c2739082986fd6b569d9e (patch) | |
tree | ff5c16475b3e30a6003d8d39f03484fb937e9e6f /spec/workers/process_commit_worker_spec.rb | |
parent | 8e156d662b7895ce8777f34882422c3714cc65c7 (diff) |
Use regex to skip unnecessary reference processing in ProcessCommitWorker
Diffstat (limited to 'spec/workers/process_commit_worker_spec.rb')
-rw-r--r-- | spec/workers/process_commit_worker_spec.rb | 8 |
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 |