Commit 9623b71a authored by Vinnie Okada's avatar Vinnie Okada

More restricted visibility changes

Bug fixes and new tests for the restricted visibility changes.
parent 928fc94c
......@@ -29,7 +29,8 @@ module ApplicationSettingsHelper
checkbox_name = 'application_setting[restricted_visibility_levels][]'
label_tag(checkbox_name, class: css_class) do
check_box_tag(checkbox_name, level, checked, autocomplete: 'off',
check_box_tag(checkbox_name, level, checked,
autocomplete: 'off',
'aria-describedby' => help_block_id) + name
end
end
......
......@@ -51,13 +51,13 @@ module API
attrs = attributes_for_keys [:title, :file_name, :visibility_level]
attrs[:content] = params[:code] if params[:code].present?
@snippet = CreateSnippetservice.new(user_project, current_user,
@snippet = CreateSnippetService.new(user_project, current_user,
attrs).execute
if @snippet.saved?
present @snippet, with: Entities::ProjectSnippet
else
if @snippet.errors.any?
render_validation_error!(@snippet)
else
present @snippet, with: Entities::ProjectSnippet
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