return commentable_id of threads
This commit is contained in:
Родитель
ff1b1765f2
Коммит
f5d3af22c3
|
@ -69,7 +69,7 @@ class CommentThread < Content
|
|||
end
|
||||
|
||||
def to_hash(params={})
|
||||
doc = as_document.slice(*%w[title body course_id created_at updated_at])
|
||||
doc = as_document.slice(*%w[title body course_id commentable_id created_at updated_at])
|
||||
.merge("id" => _id)
|
||||
.merge("user_id" => (author.id if author))
|
||||
.merge("votes" => votes.slice(*%w[count up_count down_count point]))
|
||||
|
|
|
@ -13,6 +13,7 @@ describe "app" do
|
|||
thread.body.should == response_thread["body"]
|
||||
thread.course_id.should == response_thread["course_id"]
|
||||
thread.votes_point.should == response_thread["votes"]["point"]
|
||||
thread.commentable_id.should == response_thread["commentable_id"]
|
||||
response_thread["children"].should be_nil
|
||||
end
|
||||
it "get information of a single comment thread with its comments" do
|
||||
|
|
Загрузка…
Ссылка в новой задаче