diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-06-21 08:24:03 +0200 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-03 09:34:44 +0200 |
commit | 7458ca8ebb093af93c01cb61dabca15fd0c995cb (patch) | |
tree | dd8adc950f0ac762c4236a5f81519b89edf4aec7 /spec/finders/todos_finder_spec.rb | |
parent | 57a44f2da3d2a0b59209b6c2d653d04efd0d3d41 (diff) | |
download | gitlab-ce-7458ca8ebb093af93c01cb61dabca15fd0c995cb.tar.gz |
[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/todos_finder_spec.rb')
-rw-r--r-- | spec/finders/todos_finder_spec.rb | 13 |
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 |