diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /spec/features/projects/show | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'spec/features/projects/show')
-rw-r--r-- | spec/features/projects/show/clone_button_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/features/projects/show/clone_button_spec.rb b/spec/features/projects/show/clone_button_spec.rb new file mode 100644 index 00000000000..48af4bf8277 --- /dev/null +++ b/spec/features/projects/show/clone_button_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Projects > Show > Clone button', feature_category: :projects do + let_it_be(:admin) { create(:admin) } + let_it_be(:guest) { create(:user) } + let_it_be(:project) { create(:project, :private, :in_group, :repository) } + + describe 'when checking project main page user' do + context 'with an admin role' do + before do + project.add_owner(admin) + sign_in(admin) + visit project_path(project) + end + + it 'is able to access project page' do + expect(page).to have_content project.name + end + + it 'sees clone button' do + expect(page).to have_content _('Clone') + end + end + + context 'with a guest role and no download_code access' do + before do + project.add_guest(guest) + sign_in(guest) + visit project_path(project) + end + + it 'is able to access project page' do + expect(page).to have_content project.name + end + + it 'does not see clone button' do + expect(page).not_to have_content _('Clone') + end + end + end +end |