Fix project Visibility level selector not using default values
This commit is contained in:
parent
e4c05de75c
commit
d1f0b2f433
3 changed files with 25 additions and 1 deletions
|
@ -90,7 +90,8 @@
|
|||
= f.label :visibility_level, class: 'label-light' do
|
||||
Visibility Level
|
||||
= 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
|
||||
= link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel'
|
||||
|
|
4
changelogs/unreleased/issue_20245.yml
Normal file
4
changelogs/unreleased/issue_20245.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Fix project Visibility Level selector not using default values
|
||||
merge_request:
|
||||
author:
|
19
spec/features/projects/new_project_spec.rb
Normal file
19
spec/features/projects/new_project_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
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
|
Loading…
Reference in a new issue