gitlab-org--gitlab-foss/spec/features/projects/guest_navigation_menu_spec.rb

83 lines
2.2 KiB
Ruby
Raw Normal View History

2016-10-04 08:52:08 -04:00
require 'spec_helper'
2017-05-23 03:04:47 -04:00
describe 'Guest navigation menu' do
let(:project) { create(:project, :private, public_builds: false) }
let(:guest) { create(:user) }
2016-10-04 08:52:08 -04:00
before do
project.team << [guest, :guest]
sign_in(guest)
2016-10-04 08:52:08 -04:00
end
2017-05-23 03:04:47 -04:00
it 'shows allowed tabs only' do
visit project_path(project)
2016-10-04 08:52:08 -04:00
2017-08-17 04:51:19 -04:00
within('.nav-sidebar') do
2017-08-18 07:07:10 -04:00
expect(page).to have_content 'Overview'
2016-10-04 08:52:08 -04:00
expect(page).to have_content 'Issues'
expect(page).to have_content 'Wiki'
expect(page).not_to have_content 'Repository'
expect(page).not_to have_content 'Pipelines'
expect(page).not_to have_content 'Merge Requests'
end
end
2017-05-23 03:04:47 -04:00
it 'does not show fork button' do
visit project_path(project)
2017-05-23 03:04:47 -04:00
within('.count-buttons') do
expect(page).not_to have_link 'Fork'
end
end
2017-05-23 03:04:47 -04:00
it 'does not show clone path' do
visit project_path(project)
2017-05-23 03:04:47 -04:00
within('.project-repo-buttons') do
expect(page).not_to have_selector '.project-clone-holder'
end
end
describe 'project landing page' do
before do
2017-05-23 03:04:47 -04:00
project.project_feature.update!(
issues_access_level: ProjectFeature::DISABLED,
wiki_access_level: ProjectFeature::DISABLED
)
end
2017-05-23 03:04:47 -04:00
it 'does not show the project file list landing page' do
visit project_path(project)
2017-05-23 03:04:47 -04:00
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'
2017-05-23 03:04:47 -04:00
expect(page).to have_selector '.project-show-customize_workflow'
end
2017-05-23 03:04:47 -04:00
it 'shows the customize workflow when issues and wiki are disabled' do
visit project_path(project)
2017-05-23 03:04:47 -04:00
expect(page).to have_selector '.project-show-customize_workflow'
end
2017-05-23 03:04:47 -04:00
it 'shows the wiki when enabled' do
project.project_feature.update!(wiki_access_level: ProjectFeature::PRIVATE)
visit project_path(project)
2017-05-23 03:04:47 -04:00
expect(page).to have_selector '.project-show-wiki'
end
2017-05-23 03:04:47 -04:00
it 'shows the issues when enabled' do
project.project_feature.update!(issues_access_level: ProjectFeature::PRIVATE)
visit project_path(project)
2017-05-23 03:04:47 -04:00
expect(page).to have_selector '.issues-list'
end
end
2016-10-04 08:52:08 -04:00
end