2016-10-04 08:52:08 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
describe 'Guest navigation menu' do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project, :private, public_builds: false) }
|
2016-10-13 03:38:03 -04:00
|
|
|
let(:guest) { create(:user) }
|
2016-10-04 08:52:08 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [guest, :guest]
|
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
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
|
2017-07-06 12:20:50 -04:00
|
|
|
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-04-07 18:21:16 -04:00
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
it 'does not show fork button' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-04-07 18:21:16 -04:00
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
within('.count-buttons') do
|
2017-04-07 18:21:16 -04:00
|
|
|
expect(page).not_to have_link 'Fork'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
it 'does not show clone path' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-04-07 18:21:16 -04:00
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
within('.project-repo-buttons') do
|
2017-04-07 18:21:16 -04:00
|
|
|
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
|
|
|
|
)
|
2017-04-07 18:21:16 -04:00
|
|
|
end
|
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
it 'does not show the project file list landing page' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-05-23 03:04:47 -04:00
|
|
|
|
2017-04-07 18:21:16 -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'
|
2017-04-07 18:21:16 -04:00
|
|
|
end
|
|
|
|
|
2017-05-23 03:04:47 -04:00
|
|
|
it 'shows the customize workflow when issues and wiki are disabled' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-05-23 03:04:47 -04:00
|
|
|
|
2017-04-07 18:21:16 -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)
|
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-05-23 03:04:47 -04:00
|
|
|
|
2017-04-07 18:21:16 -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)
|
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2017-05-23 03:04:47 -04:00
|
|
|
|
2017-04-07 18:21:16 -04:00
|
|
|
expect(page).to have_selector '.issues-list'
|
|
|
|
end
|
|
|
|
end
|
2016-10-04 08:52:08 -04:00
|
|
|
end
|