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-09-15 13:28:21 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 23:49:41 +0300
commit9781ac552d4ae41983b2d95768e0fb06817e0ef9 (patch)
tree8beef5af5c8ac701ce53fcf47591d0ea1f6aff32 /spec/controllers/groups_controller_spec.rb
parent20a08965bc949ea233cdde4e777698222fcabff2 (diff)
Include pagination when rendering expanded hierarchies
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r--spec/controllers/groups_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index 18791a01035..21d5433a970 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -152,6 +152,10 @@ describe GroupsController do
describe 'GET #show' do
context 'pagination' do
+ before do
+ allow(Kaminari.config).to receive(:default_per_page).and_return(2)
+ end
+
context 'with only projects' do
let!(:other_project) { create(:project, :public, namespace: group) }
let!(:first_page_projects) { create_list(:project, Kaminari.config.default_per_page, :public, namespace: group ) }
@@ -288,6 +292,14 @@ describe GroupsController do
expect(group_json['id']).to eq(public_subgroup.id)
expect(matched_group_json['id']).to eq(matched_group.id)
end
+
+ it 'includes pagination headers' do
+ 2.times { |i| create(:group, :public, parent: public_subgroup, name: "filterme#{i}") }
+
+ get :children, id: group.to_param, filter: 'filter', per_page: 1, format: :json
+
+ expect(response).to include_pagination_headers
+ end
end
context 'queries per rendered element', :request_store do