diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-04 13:33:42 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-04-04 13:33:42 +0000 |
commit | 796d65f1feeb13c5bbdedee3f7290bd962c4c421 (patch) | |
tree | fee4fcfd24818c3bef0bde6faf1b6c1b51aeb887 /spec/workers | |
parent | 7f8f927aafb0f3a618ccce76e802e30a16b04b42 (diff) | |
parent | e52b1df1d5391f0fa0b9ec7eb2d3492b05f64ba4 (diff) | |
download | gitlab-ce-796d65f1feeb13c5bbdedee3f7290bd962c4c421.tar.gz |
Merge branch '29492-useless-queries' into 'master'
remove useless queries with false conditions (e.g 1=0)
Closes #29492
See merge request !10141
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/process_commit_worker_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/workers/process_commit_worker_spec.rb b/spec/workers/process_commit_worker_spec.rb index 1c383d0514d..9afe2e610b9 100644 --- a/spec/workers/process_commit_worker_spec.rb +++ b/spec/workers/process_commit_worker_spec.rb @@ -99,6 +99,13 @@ describe ProcessCommitWorker do expect(metric.first_mentioned_in_commit_at).to eq(commit.committed_date) end + + it "doesn't execute any queries with false conditions" do + allow(commit).to receive(:safe_message). + and_return("Lorem Ipsum") + + expect { worker.update_issue_metrics(commit, user) }.not_to make_queries_matching(/WHERE (?:1=0|0=1)/) + end end describe '#build_commit' do |