diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-18 10:31:41 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-20 18:13:13 +0200 |
commit | f3f1df1476ba7fe223e5d8d6707a7675dc9fa597 (patch) | |
tree | b821f022ed4fd4201a3b86888f0d4a65b60d0411 /spec/services/issues | |
parent | 03b88937757238c26a0bd2f3446dde03e7041b36 (diff) | |
download | gitlab-ce-f3f1df1476ba7fe223e5d8d6707a7675dc9fa597.tar.gz |
Add a cop for `FinderMethods`bvl-finder-methods-cop
This notifies developers when calling `find(_by!)` chained on
`execute`. And suggests using the methods from `FinderMethods`. These
will perform the correct authorization checks on the resource when it
is found.
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/resolve_discussions_spec.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/spec/services/issues/resolve_discussions_spec.rb b/spec/services/issues/resolve_discussions_spec.rb index 13accc6ae1b..b6cfc09da65 100644 --- a/spec/services/issues/resolve_discussions_spec.rb +++ b/spec/services/issues/resolve_discussions_spec.rb @@ -31,10 +31,8 @@ describe Issues::ResolveDiscussions do it "only queries for the merge request once" do fake_finder = double - fake_results = double - expect(fake_finder).to receive(:execute).and_return(fake_results).exactly(1) - expect(fake_results).to receive(:find_by).exactly(1) + expect(fake_finder).to receive(:find_by).exactly(1) expect(MergeRequestsFinder).to receive(:new).and_return(fake_finder).exactly(1) 2.times { service.merge_request_to_resolve_discussions_of } |