Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-02-20 15:33:49 +0300
committerSean McGivern <sean@gitlab.com>2018-02-21 13:31:29 +0300
commitc2fc40668c34215a7e727e60647114f1b178eb8c (patch)
tree75736437f7657fa617dd3a48376b73bd46e0c9fc /spec/controllers
parent5048c8d5050cd432381d845997c5e7991e6590f1 (diff)
Refactor IssuableFinder to extract model-specific logic
By extracting a new `filter_items` method, we can override that in the IssuesFinder and MergeRequestsFinder separately, so we don't need checks that the model is the correct one, because we can just use the class we're in to know that. We can do the same for the VALID_PARAMS constant, by making it a class method.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/concerns/issuable_collections_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/controllers/concerns/issuable_collections_spec.rb b/spec/controllers/concerns/issuable_collections_spec.rb
index d7825364ed5..c1f42bbb9d7 100644
--- a/spec/controllers/concerns/issuable_collections_spec.rb
+++ b/spec/controllers/concerns/issuable_collections_spec.rb
@@ -8,6 +8,10 @@ describe IssuableCollections do
def self.helper_method(name); end
include IssuableCollections
+
+ def finder_type
+ IssuesFinder
+ end
end
controller = klass.new