Commit a32912cc by Rocky Duan

return depth of comment

parent 78111bf1
......@@ -42,6 +42,7 @@ class Comment < Content
as_document.slice(*%w[body course_id endorsed created_at updated_at])
.merge("id" => _id)
.merge("user_id" => (author.id if author))
.merge("depth" => depth)
.merge("thread_id" => comment_thread.id)
.merge("votes" => votes.slice(*%w[count up_count down_count point]))
end
......
......@@ -14,6 +14,7 @@ describe "app" do
retrieved["id"].should == comment.id.to_s
retrieved["children"].should be_nil
retrieved["votes"]["point"].should == comment.votes_point
retrieved["depth"].should == comment.depth
end
it "retrieve information of a single comment with its sub comments" do
comment = Comment.first
......
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