Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2018-02-05 22:32:59 +0300
committerFelipe Artur <felipefac@gmail.com>2018-02-05 22:32:59 +0300
commitb35ee324fd3445c05a2bf0e24cf81c0d9048a43f (patch)
tree18ec22b3a9621dded70ebbb81e8140be6fbdee11 /app/controllers/projects
parent3759dd5a590f09f6f8132d4bf49af40f74b0ccf8 (diff)
Add specs to discussions controller
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/discussions_controller.rb5
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!