Commit d1f0b2f4 authored by Felipe Artur's avatar Felipe Artur

Fix project Visibility level selector not using default values

parent e4c05de7
...@@ -90,7 +90,8 @@ ...@@ -90,7 +90,8 @@
= f.label :visibility_level, class: 'label-light' do = f.label :visibility_level, class: 'label-light' do
Visibility Level Visibility Level
= link_to "(?)", help_page_path("public_access/public_access") = link_to "(?)", help_page_path("public_access/public_access")
= render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project) = render 'shared/visibility_level', f: f, visibility_level: default_project_visibility, can_change_visibility_level: true, form_model: @project
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
= link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel' = link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel'
......
---
title: Fix project Visibility Level selector not using default values
merge_request:
author:
require "spec_helper"
feature "New project", feature: true do
context "Visibility level selector" do
let(:user) { create(:admin) }
before { login_as(user) }
Gitlab::VisibilityLevel.options.each do |key, level|
it "sets selector to #{key}" do
stub_application_setting(default_project_visibility: level)
visit new_project_path
expect(find_field("project_visibility_level_#{level}")).to be_checked
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