diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/features/projects/ci/secure_files_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/features/projects/ci/secure_files_spec.rb')
-rw-r--r-- | spec/features/projects/ci/secure_files_spec.rb | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/spec/features/projects/ci/secure_files_spec.rb b/spec/features/projects/ci/secure_files_spec.rb index 65c41eaf2ac..a0e9d663d35 100644 --- a/spec/features/projects/ci/secure_files_spec.rb +++ b/spec/features/projects/ci/secure_files_spec.rb @@ -7,13 +7,55 @@ RSpec.describe 'Secure Files', :js do let(:user) { create(:user) } before do + stub_feature_flags(ci_secure_files_read_only: false) project.add_maintainer(user) sign_in(user) + end + it 'user sees the Secure Files list component' do visit project_ci_secure_files_path(project) + expect(page).to have_content('There are no records to show') end - it 'user sees the Secure Files list component' do + it 'prompts the user to confirm before deleting a file' do + file = create(:ci_secure_file, project: project) + + visit project_ci_secure_files_path(project) + + expect(page).to have_content(file.name) + + find('button.btn-danger').click + + expect(page).to have_content("Delete #{file.name}?") + + click_on('Delete secure file') + + visit project_ci_secure_files_path(project) + + expect(page).not_to have_content(file.name) + end + + it 'displays an uploaded file in the file list' do + visit project_ci_secure_files_path(project) expect(page).to have_content('There are no records to show') + + page.attach_file('spec/fixtures/ci_secure_files/upload-keystore.jks') do + click_button 'Upload File' + end + + expect(page).to have_content('upload-keystore.jks') + end + + it 'displays an error when a duplicate file upload is attempted' do + create(:ci_secure_file, project: project, name: 'upload-keystore.jks') + visit project_ci_secure_files_path(project) + + expect(page).to have_content('upload-keystore.jks') + + page.attach_file('spec/fixtures/ci_secure_files/upload-keystore.jks') do + click_button 'Upload File' + end + + expect(page).to have_content('A file with this name already exists.') end end |