summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-02-16 20:17:12 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-02-16 22:51:38 +0000
commit9f00c2b0d2362232b49ef260e0500b14b975e574 (patch)
tree33cdb01eb5e301c95b01a6478dc6e48032d06ea6
parente1af42ce4e2a5097374e0e0e6c37a3291abb8835 (diff)
downloadgitlab-ce-28248-use-page.tar.gz
Reduce number of pipelines created to test pagination28248-use-page
stub pagination in tests
-rw-r--r--app/assets/javascripts/vue_pipelines_index/pipelines.js.es62
-rw-r--r--spec/features/projects/pipelines/pipelines_spec.rb11
2 files changed, 6 insertions, 7 deletions
diff --git a/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 b/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
index d39a7a9aaa3..0265c00a414 100644
--- a/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+++ b/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
@@ -56,7 +56,7 @@ const CommitPipelinesStoreWithTimeAgo = require('../commit/pipelines/pipelines_s
*/
change(pagenum, apiScope) {
if (!apiScope) apiScope = 'all';
- gl.utils.visitUrl(`?scope=${apiScope}&p=${pagenum}`);
+ gl.utils.visitUrl(`?scope=${apiScope}&page=${pagenum}`);
},
},
template: `
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb
index 06f953a50d7..8d1214dedb4 100644
--- a/spec/features/projects/pipelines/pipelines_spec.rb
+++ b/spec/features/projects/pipelines/pipelines_spec.rb
@@ -288,23 +288,22 @@ describe 'Pipelines', :feature, :js do
context 'with pagination' do
before do
- create_list(:ci_empty_pipeline, 40, project: project)
+ allow(Ci::Pipeline).to receive(:default_per_page).and_return(1)
+ create(:ci_empty_pipeline, project: project)
end
it 'should render pagination' do
visit namespace_project_pipelines_path(project.namespace, project)
wait_for_vue_resource
- expect(page).to have_css('.gl-pagination')
- expect(page.find_all('tbody tr').length).to eq(20)
+ expect(page).to have_selector('.gl-pagination')
end
- it "should render second page of pipelines" do
+ it 'should render second page of pipelines' do
visit namespace_project_pipelines_path(project.namespace, project, page: '2')
wait_for_vue_resource
- expect(page).to have_css('.gl-pagination')
- expect(page.find_all('tbody tr').length).to eq(20)
+ expect(page).to have_selector('.gl-pagination .page', count: 2)
end
end
end