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:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-02 08:55:44 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 23:49:42 +0300
commitaf0b8e0558f529cd79a9dd061dc54ae3bfa9d1dd (patch)
treed43594a335fb21e6f140f4a5013e45de272ea8e7 /spec/controllers/groups_controller_spec.rb
parentab5d5b7ecea5d68c00171d0750b1b2f62ffbe55d (diff)
Only preload ancestors for search results in the specified parent
When filtering we want all to preload all the ancestors upto the specified parent group. - root - subgroup - nested-group - project So when searching 'project', on the 'subgroup' page we want to preload 'nested-group' but not 'subgroup' or 'root'
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r--spec/controllers/groups_controller_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index 575f70440e1..d33251f2641 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -319,6 +319,16 @@ describe GroupsController do
expect(matched_project_2_json['id']).to eq(matched_project_2.id)
end
+ it 'expands the tree upto a specified parent' do
+ subgroup = create(:group, :public, parent: group)
+ l2_subgroup = create(:group, :public, parent: subgroup)
+ create(:project, :public, namespace: l2_subgroup, name: 'test')
+
+ get :children, id: subgroup.to_param, filter: 'test', format: :json
+
+ expect(response).to have_http_status(200)
+ end
+
it 'includes pagination headers' do
2.times { |i| create(:group, :public, parent: public_subgroup, name: "filterme#{i}") }