Commit f97e532e authored by Jamie Schembri's avatar Jamie Schembri Committed by Rémy Coutable

Fix #47379 - Project visibility tooltip

parent 6d5edce8
......@@ -126,10 +126,9 @@ module VisibilityLevelHelper
end
def visibility_icon_description(form_model)
case form_model
when Project
if form_model.respond_to?(:visibility_level_allowed_as_fork?)
project_visibility_icon_description(form_model.visibility_level)
when Group
elsif form_model.respond_to?(:visibility_level_allowed_by_sub_groups?)
group_visibility_icon_description(form_model.visibility_level)
end
end
......
---
title: Fix project visibility tooltip
merge_request: 20535
author: Jamie Schembri
type: fixed
......@@ -6,6 +6,29 @@ describe VisibilityLevelHelper do
let(:personal_snippet) { build(:personal_snippet) }
let(:project_snippet) { build(:project_snippet) }
describe 'visibility_icon_description' do
context 'used with a Project' do
it 'delegates projects to #project_visibility_icon_description' do
expect(visibility_icon_description(project))
.to match /project/i
end
context 'used with a ProjectPresenter' do
it 'delegates projects to #project_visibility_icon_description' do
expect(visibility_icon_description(project.present))
.to match /project/i
end
end
context 'used with a Group' do
it 'delegates groups to #group_visibility_icon_description' do
expect(visibility_icon_description(group))
.to match /group/i
end
end
end
end
describe 'visibility_level_description' do
context 'used with a Project' do
it 'delegates projects to #project_visibility_level_description' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment