summaryrefslogtreecommitdiff
path: root/spec/controllers/groups_controller_spec.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-26 21:31:32 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:49:42 +0200
commitab5d5b7ecea5d68c00171d0750b1b2f62ffbe55d (patch)
tree9f0b5df21e94888cb00d2ec1cb1ea7f23b61f578 /spec/controllers/groups_controller_spec.rb
parent7a3ba8e9845b89c9f3f37d43e8edfeaa9093cfdf (diff)
downloadgitlab-ce-ab5d5b7ecea5d68c00171d0750b1b2f62ffbe55d.tar.gz
Make sure all queries are limited to the page size
And fix some pagination bugs
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r--spec/controllers/groups_controller_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index ff76eaee25f..575f70440e1 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -174,18 +174,18 @@ describe GroupsController do
end
context 'with subgroups and projects', :nested_groups do
+ let!(:first_page_subgroups) { create_list(:group, Kaminari.config.default_per_page, parent: group) }
let!(:other_subgroup) { create(:group, :public, parent: group) }
let!(:project) { create(:project, :public, namespace: group) }
- let!(:first_page_subgroups) { create_list(:group, Kaminari.config.default_per_page, parent: group) }
it 'contains all subgroups' do
- get :children, id: group.to_param, sort: 'id_desc', format: :json
+ get :children, id: group.to_param, sort: 'id_asc', format: :json
expect(assigns(:children)).to contain_exactly(*first_page_subgroups)
end
it 'contains the project and group on the second page' do
- get :children, id: group.to_param, sort: 'id_desc', page: 2, format: :json
+ get :children, id: group.to_param, sort: 'id_asc', page: 2, format: :json
expect(assigns(:children)).to contain_exactly(other_subgroup, project)
end