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:
Diffstat (limited to 'spec/features/projects/environments/environments_spec.rb')
-rw-r--r--spec/features/projects/environments/environments_spec.rb80
1 files changed, 55 insertions, 25 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb
index 27167f95104..de7ff1c473d 100644
--- a/spec/features/projects/environments/environments_spec.rb
+++ b/spec/features/projects/environments/environments_spec.rb
@@ -429,37 +429,67 @@ RSpec.describe 'Environments page', :js do
end
describe 'environments folders' do
- before do
- create(:environment, :will_auto_stop,
- project: project,
- name: 'staging/review-1',
- state: :available)
- create(:environment, :will_auto_stop,
- project: project,
- name: 'staging/review-2',
- state: :available)
- end
+ describe 'available environments' do
+ before do
+ create(:environment, :will_auto_stop,
+ project: project,
+ name: 'staging/review-1',
+ state: :available)
+ create(:environment, :will_auto_stop,
+ project: project,
+ name: 'staging/review-2',
+ state: :available)
+ end
- it 'users unfurls an environment folder' do
- visit_environments(project)
+ it 'users unfurls an environment folder' do
+ visit_environments(project)
- expect(page).not_to have_content 'review-1'
- expect(page).not_to have_content 'review-2'
- expect(page).to have_content 'staging 2'
+ expect(page).not_to have_content 'review-1'
+ expect(page).not_to have_content 'review-2'
+ expect(page).to have_content 'staging 2'
- within('.folder-row') do
- find('.folder-name', text: 'staging').click
- end
+ within('.folder-row') do
+ find('.folder-name', text: 'staging').click
+ end
- expect(page).to have_content 'review-1'
- expect(page).to have_content 'review-2'
- within('.ci-table') do
- within('[data-qa-selector="environment_item"]', text: 'review-1') do
- expect(find('.js-auto-stop').text).not_to be_empty
+ expect(page).to have_content 'review-1'
+ expect(page).to have_content 'review-2'
+ within('.ci-table') do
+ within('[data-qa-selector="environment_item"]', text: 'review-1') do
+ expect(find('.js-auto-stop').text).not_to be_empty
+ end
+ within('[data-qa-selector="environment_item"]', text: 'review-2') do
+ expect(find('.js-auto-stop').text).not_to be_empty
+ end
end
- within('[data-qa-selector="environment_item"]', text: 'review-2') do
- expect(find('.js-auto-stop').text).not_to be_empty
+ end
+ end
+
+ describe 'stopped environments' do
+ before do
+ create(:environment, :will_auto_stop,
+ project: project,
+ name: 'staging/review-1',
+ state: :stopped)
+ create(:environment, :will_auto_stop,
+ project: project,
+ name: 'staging/review-2',
+ state: :stopped)
+ end
+
+ it 'users unfurls an environment folder' do
+ visit_environments(project, scope: 'stopped')
+
+ expect(page).not_to have_content 'review-1'
+ expect(page).not_to have_content 'review-2'
+ expect(page).to have_content 'staging 2'
+
+ within('.folder-row') do
+ find('.folder-name', text: 'staging').click
end
+
+ expect(page).to have_content 'review-1'
+ expect(page).to have_content 'review-2'
end
end
end