summaryrefslogtreecommitdiff
path: root/spec/features/projects/environments
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-02-26 22:17:50 -0800
committerStan Hu <stanhu@gmail.com>2019-02-26 23:01:09 -0800
commit43ac2a964ffe5f2713cb3093b4192216ec8525ad (patch)
tree2bcf0a78410dda2e8fc76885442c1b56d599d9b6 /spec/features/projects/environments
parent7765e6ec108f1c159e5b38d2048d4095861f6288 (diff)
downloadgitlab-ce-43ac2a964ffe5f2713cb3093b4192216ec8525ad.tar.gz
Add pagination spec and improve filtering of null values
Diffstat (limited to 'spec/features/projects/environments')
-rw-r--r--spec/features/projects/environments/environments_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb
index 0c517d5f490..66c6545204b 100644
--- a/spec/features/projects/environments/environments_spec.rb
+++ b/spec/features/projects/environments/environments_spec.rb
@@ -38,6 +38,23 @@ describe 'Environments page', :js do
end
end
+ describe 'with environments spanning multiple pages', :js do
+ before do
+ allow(Kaminari.config).to receive(:default_per_page).and_return(3)
+ create_list(:environment, 4, project: project, state: :available)
+ end
+
+ it 'should render second page of pipelines' do
+ visit_environments(project, scope: 'available')
+
+ find('.js-next-button').click
+ wait_for_requests
+
+ expect(page).to have_selector('.gl-pagination .page', count: 2)
+ expect(find('.gl-pagination .page-item.active .page-link').text).to eq("2")
+ end
+ end
+
describe 'in stopped tab page' do
it 'should show no environments' do
visit_environments(project, scope: 'stopped')