diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/features/projects/user_sees_sidebar_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/features/projects/user_sees_sidebar_spec.rb')
-rw-r--r-- | spec/features/projects/user_sees_sidebar_spec.rb | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/spec/features/projects/user_sees_sidebar_spec.rb b/spec/features/projects/user_sees_sidebar_spec.rb index 50d7b353c46..616c5065c07 100644 --- a/spec/features/projects/user_sees_sidebar_spec.rb +++ b/spec/features/projects/user_sees_sidebar_spec.rb @@ -128,6 +128,59 @@ RSpec.describe 'Projects > User sees sidebar' do end end + context 'as anonymous' do + let(:project) { create(:project, :public) } + let!(:issue) { create(:issue, :opened, project: project, author: user) } + + describe 'project landing page' do + before do + project.project_feature.update!( + builds_access_level: ProjectFeature::DISABLED, + merge_requests_access_level: ProjectFeature::DISABLED, + repository_access_level: ProjectFeature::DISABLED, + issues_access_level: ProjectFeature::DISABLED, + wiki_access_level: ProjectFeature::DISABLED + ) + end + + it 'does not show the project file list landing page, but the activity' do + visit project_path(project) + + expect(page).not_to have_selector '.project-stats' + expect(page).not_to have_selector '.project-last-commit' + expect(page).not_to have_selector '.project-show-files' + expect(page).to have_selector '.project-show-activity' + end + + it 'shows the wiki when enabled' do + project.project_feature.update!(wiki_access_level: ProjectFeature::ENABLED) + + visit project_path(project) + + expect(page).to have_selector '.project-show-wiki' + end + + it 'shows the issues when enabled' do + project.project_feature.update!(issues_access_level: ProjectFeature::ENABLED) + + visit project_path(project) + + expect(page).to have_selector '.issues-list' + end + + it 'shows the wiki when wiki and issues are enabled' do + project.project_feature.update!( + issues_access_level: ProjectFeature::ENABLED, + wiki_access_level: ProjectFeature::ENABLED + ) + + visit project_path(project) + + expect(page).to have_selector '.project-show-wiki' + end + end + end + context 'as guest' do let(:guest) { create(:user) } let!(:issue) { create(:issue, :opened, project: project, author: guest) } @@ -145,11 +198,11 @@ RSpec.describe 'Projects > User sees sidebar' do expect(page).to have_content 'Project' expect(page).to have_content 'Issues' expect(page).to have_content 'Wiki' + expect(page).to have_content 'Operations' expect(page).not_to have_content 'Repository' expect(page).not_to have_content 'CI / CD' expect(page).not_to have_content 'Merge Requests' - expect(page).not_to have_content 'Operations' end end @@ -194,13 +247,13 @@ RSpec.describe 'Projects > User sees sidebar' do expect(page).not_to have_selector '.project-stats' expect(page).not_to have_selector '.project-last-commit' expect(page).not_to have_selector '.project-show-files' - expect(page).to have_selector '.project-show-customize_workflow' + expect(page).to have_selector '.project-show-activity' end - it 'shows the customize workflow when issues and wiki are disabled' do + it 'shows the project activity when issues and wiki are disabled' do visit project_path(project) - expect(page).to have_selector '.project-show-customize_workflow' + expect(page).to have_selector '.project-show-activity' end it 'shows the wiki when enabled' do |