diff options
author | Felipe Artur <felipefac@gmail.com> | 2018-02-05 22:32:59 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-02-05 22:32:59 +0300 |
commit | b35ee324fd3445c05a2bf0e24cf81c0d9048a43f (patch) | |
tree | 18ec22b3a9621dded70ebbb81e8140be6fbdee11 /app/controllers/projects | |
parent | 3759dd5a590f09f6f8132d4bf49af40f74b0ccf8 (diff) |
Add specs to discussions controller
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/discussions_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/discussions_controller.rb b/app/controllers/projects/discussions_controller.rb index 5eb5a75a617..6efe7657ad4 100644 --- a/app/controllers/projects/discussions_controller.rb +++ b/app/controllers/projects/discussions_controller.rb @@ -35,12 +35,13 @@ class Projects::DiscussionsController < Projects::ApplicationController def render_json_with_discussions_serializer render json: DiscussionSerializer.new(project: project, noteable: discussion.noteable, current_user: current_user) - .represent(discussion, context: self, skip_notes_rendering: true) + .represent(discussion, context: self) end # Legacy method used to render discussions notes when not using Vue on views. def render_json_with_html render json: { + resolved_by: discussion.resolved_by.try(:name), discussion_headline_html: view_to_html_string('discussions/_headline', discussion: discussion) } end @@ -50,7 +51,7 @@ class Projects::DiscussionsController < Projects::ApplicationController end def discussion - @discussion ||= @merge_request.find_discussion(params[:id], current_user) || render_404 + @discussion ||= @merge_request.find_discussion(params[:id]) || render_404 end def authorize_resolve_discussion! |