diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-28 21:09:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-28 21:09:07 +0300 |
commit | 1c8fa70f9d0818e2a82089c8643a6e455bca47fd (patch) | |
tree | f339f97de0425270bdd909e2f4d378927b6e0a18 /spec/features | |
parent | 736d36d8597d0d1ec1b47644e6d091c3f4a78f45 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
4 files changed, 38 insertions, 34 deletions
diff --git a/spec/features/groups/settings/ci_cd_spec.rb b/spec/features/groups/settings/ci_cd_spec.rb index 5b1a9512c55..3fbc7c7a695 100644 --- a/spec/features/groups/settings/ci_cd_spec.rb +++ b/spec/features/groups/settings/ci_cd_spec.rb @@ -37,6 +37,19 @@ describe 'Group CI/CD settings' do end end + context 'Deploy tokens' do + let!(:deploy_token) { create(:deploy_token, :group, groups: [group]) } + + before do + stub_container_registry_config(enabled: true) + visit group_settings_ci_cd_path(group) + end + + it_behaves_like 'a deploy token in ci/cd settings' do + let(:entity_type) { 'group' } + end + end + describe 'Auto DevOps form' do before do stub_application_setting(auto_devops_enabled: true) diff --git a/spec/features/projects/settings/ci_cd_settings_spec.rb b/spec/features/projects/settings/ci_cd_settings_spec.rb new file mode 100644 index 00000000000..e69ee31e582 --- /dev/null +++ b/spec/features/projects/settings/ci_cd_settings_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Projects > Settings > CI/CD settings' do + let(:project) { create(:project_empty_repo) } + let(:user) { create(:user) } + let(:role) { :maintainer } + + context 'Deploy tokens' do + let!(:deploy_token) { create(:deploy_token, projects: [project]) } + + before do + project.add_role(user, role) + sign_in(user) + stub_container_registry_config(enabled: true) + visit project_settings_ci_cd_path(project) + end + + it_behaves_like 'a deploy token in ci/cd settings' do + let(:entity_type) { 'project' } + end + end +end diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index 18031a40f15..d750234d9ad 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -108,39 +108,6 @@ describe 'Projects > Settings > Repository settings' do end end - context 'Deploy tokens' do - let!(:deploy_token) { create(:deploy_token, projects: [project]) } - - before do - stub_container_registry_config(enabled: true) - visit project_settings_repository_path(project) - end - - it 'view deploy tokens' do - within('.deploy-tokens') do - expect(page).to have_content(deploy_token.name) - expect(page).to have_content('read_repository') - expect(page).to have_content('read_registry') - end - end - - it 'add a new deploy token' do - fill_in 'deploy_token_name', with: 'new_deploy_key' - fill_in 'deploy_token_expires_at', with: (Date.today + 1.month).to_s - fill_in 'deploy_token_username', with: 'deployer' - check 'deploy_token_read_repository' - check 'deploy_token_read_registry' - click_button 'Create deploy token' - - expect(page).to have_content('Your new project deploy token has been created') - - within('.created-deploy-token-container') do - expect(page).to have_selector("input[name='deploy-token-user'][value='deployer']") - expect(page).to have_selector("input[name='deploy-token'][readonly='readonly']") - end - end - end - context 'remote mirror settings' do let(:user2) { create(:user) } diff --git a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb index 3e9bfed1e47..a9253c20896 100644 --- a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb +++ b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb @@ -11,7 +11,7 @@ describe 'Repository Settings > User sees revoke deploy token modal', :js do before do project.add_role(user, role) sign_in(user) - visit(project_settings_repository_path(project)) + visit(project_settings_ci_cd_path(project)) click_link('Revoke') end |