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:
authorJan Provaznik <jprovaznik@gitlab.com>2018-06-21 09:24:03 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-07-03 10:34:44 +0300
commit7458ca8ebb093af93c01cb61dabca15fd0c995cb (patch)
treedd8adc950f0ac762c4236a5f81519b89edf4aec7 /spec/finders
parent57a44f2da3d2a0b59209b6c2d653d04efd0d3d41 (diff)
[backend] Addressed review comments
* Group filtering now includes also issues/MRs from subgroups/subprojects * fixed due_date * Also DRYed todo controller specs
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/todos_finder_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb
index 50046db5497..6061021d3b0 100644
--- a/spec/finders/todos_finder_spec.rb
+++ b/spec/finders/todos_finder_spec.rb
@@ -53,7 +53,7 @@ describe TodosFinder do
it 'returns correct todos when filtered by a group' do
todos = finder.new(user, { group_id: group.id }).execute
- expect(todos).to match_array([todo2])
+ expect(todos).to match_array([todo1, todo2])
end
it 'returns correct todos when filtered by a type' do
@@ -61,6 +61,17 @@ describe TodosFinder do
expect(todos).to match_array([todo1])
end
+
+ context 'with subgroups', :nested_groups do
+ let(:subgroup) { create(:group, parent: group) }
+ let!(:todo3) { create(:todo, user: user, group: subgroup, target: issue) }
+
+ it 'returns todos from subgroups when filtered by a group' do
+ todos = finder.new(user, { group_id: group.id }).execute
+
+ expect(todos).to match_array([todo1, todo2, todo3])
+ end
+ end
end
end