Commit b2eae552 authored by Douwe Maan's avatar Douwe Maan Committed by Bob Van Landuyt

Fix specs to expect new CE strings that haven't made it to EE yet

parent 7bb826fe
...@@ -141,15 +141,11 @@ module ProjectsHelper ...@@ -141,15 +141,11 @@ module ProjectsHelper
if @project.private? if @project.private?
level = @project.project_feature.send(field) level = @project.project_feature.send(field)
disabled_option = ProjectFeature::ENABLED options.delete('Everyone with access')
highest_available_option = ProjectFeature::PRIVATE if level == disabled_option highest_available_option = options.values.max if level == ProjectFeature::ENABLED
end end
options = options_for_select( options = options_for_select(options, selected: highest_available_option || @project.project_feature.public_send(field))
options.invert,
selected: highest_available_option || @project.project_feature.public_send(field),
disabled: disabled_option
)
content_tag( content_tag(
:select, :select,
...@@ -485,9 +481,9 @@ module ProjectsHelper ...@@ -485,9 +481,9 @@ module ProjectsHelper
def project_feature_options def project_feature_options
{ {
ProjectFeature::DISABLED => s_('ProjectFeature|Disabled'), s_('ProjectFeature|Disabled') => ProjectFeature::DISABLED,
ProjectFeature::PRIVATE => s_('ProjectFeature|Only team members'), s_('ProjectFeature|Only team members') => ProjectFeature::PRIVATE,
ProjectFeature::ENABLED => s_('ProjectFeature|Everyone with access') s_('ProjectFeature|Everyone with access') => ProjectFeature::ENABLED
} }
end end
......
...@@ -14,7 +14,7 @@ Constants for project visibility levels are next: ...@@ -14,7 +14,7 @@ Constants for project visibility levels are next:
The project can be cloned by any logged in user. The project can be cloned by any logged in user.
* `public`: * `public`:
The project can be cloned without any authentication. The project can be accessed without any authentication.
## List projects ## List projects
......
...@@ -14,7 +14,7 @@ feature 'Visibility settings', feature: true, js: true do ...@@ -14,7 +14,7 @@ feature 'Visibility settings', feature: true, js: true do
visibility_select_container = find('.js-visibility-select') visibility_select_container = find('.js-visibility-select')
expect(visibility_select_container.find('.visibility-select').value).to eq project.visibility_level.to_s expect(visibility_select_container.find('.visibility-select').value).to eq project.visibility_level.to_s
expect(visibility_select_container).to have_content 'The project can be cloned without any authentication.' expect(visibility_select_container).to have_content 'The project can be accessed without any authentication.'
end end
scenario 'project visibility description updates on change' do scenario 'project visibility description updates on change' do
...@@ -41,7 +41,7 @@ feature 'Visibility settings', feature: true, js: true do ...@@ -41,7 +41,7 @@ feature 'Visibility settings', feature: true, js: true do
expect(visibility_select_container).not_to have_select '.visibility-select' expect(visibility_select_container).not_to have_select '.visibility-select'
expect(visibility_select_container).to have_content 'Public' expect(visibility_select_container).to have_content 'Public'
expect(visibility_select_container).to have_content 'The project can be cloned without any authentication.' expect(visibility_select_container).to have_content 'The project can be accessed without any authentication.'
end end
end end
end end
...@@ -37,7 +37,7 @@ describe VisibilityLevelHelper do ...@@ -37,7 +37,7 @@ describe VisibilityLevelHelper do
it "describes public projects" do it "describes public projects" do
expect(project_visibility_level_description(Gitlab::VisibilityLevel::PUBLIC)) expect(project_visibility_level_description(Gitlab::VisibilityLevel::PUBLIC))
.to eq "The project can be cloned without any authentication." .to eq "The project can be accessed without any authentication."
end end
end end
......
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