More restricted visibility changes

Bug fixes and new tests for the restricted visibility changes.
This commit is contained in:
Vinnie Okada 2015-03-10 18:21:09 -06:00
parent 928fc94c3d
commit 9623b71a39
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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