diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-03-31 11:03:14 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-03-31 11:03:14 +0100 |
commit | db749d5d457e31d88e70a95ded35a850071359dd (patch) | |
tree | 44ea7a1097c3d6b4170b8ad51bfb86856116c84f | |
parent | d3ab245a5be3c840c0a6e7de1a6488a7f8170115 (diff) | |
download | gitlab-ce-28732-expandable-folders.tar.gz |
Adds tests for scoped tabs28732-expandable-folders
-rw-r--r-- | spec/features/projects/environments/environments_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 641e2cf7402..92a8abdca7b 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -23,6 +23,42 @@ feature 'Environments page', :feature, :js do expect(page).to have_link('Available') expect(page).to have_link('Stopped') end + + describe 'with one available environment' do + given(:environment) { create(:environment, project: project, state: :available) } + + describe 'in available tab page' do + it 'should show one environment' do + visit namespace_project_environments_path(project.namespace, project, scope: 'available') + expect(page.all('tbody > tr').length).to eq(1) + end + end + + describe 'in stopped tab page' do + it 'should show no environments' do + visit namespace_project_environments_path(project.namespace, project, scope: 'stopped') + expect(page).to have_content('You don\'t have any environments right now') + end + end + end + + describe 'with one stopped environment' do + given(:environment) { create(:environment, project: project, state: :stopped) } + + describe 'in available tab page' do + it 'should show no environments' do + visit namespace_project_environments_path(project.namespace, project, scope: 'available') + expect(page).to have_content('You don\'t have any environments right now') + end + end + + describe 'in stopped tab page' do + it 'should show one environment' do + visit namespace_project_environments_path(project.namespace, project, scope: 'stopped') + expect(page.all('tbody > tr').length).to eq(1) + end + end + end end context 'without environments' do |