Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
93774c73
Commit
93774c73
authored
May 22, 2015
by
Greg Price
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use thread presenter in thread creation response
parent
c32591b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
api/commentables.rb
+2
-1
spec/api/commentable_spec.rb
+4
-0
No files found.
api/commentables.rb
View file @
93774c73
...
...
@@ -41,6 +41,7 @@ post "#{APIPREFIX}/:commentable_id/threads" do |commentable_id|
error
400
,
thread
.
errors
.
full_messages
.
to_json
else
user
.
subscribe
(
thread
)
if
bool_auto_subscribe
thread
.
to_hash
.
to_json
presenter
=
ThreadPresenter
.
factory
(
thread
,
nil
)
presenter
.
to_hash
.
to_json
end
end
spec/api/commentable_spec.rb
View file @
93774c73
...
...
@@ -93,6 +93,10 @@ describe "app" do
old_count
=
CommentThread
.
count
post
'/api/v1/question_1/threads'
,
default_params
last_response
.
should
be_ok
result
=
parse
(
last_response
.
body
)
result
[
"read"
].
should
==
false
result
[
"unread_comments_count"
].
should
==
0
result
[
"endorsed"
].
should
==
false
CommentThread
.
count
.
should
==
old_count
+
1
CommentThread
.
where
(
title:
"Interesting question"
).
first
.
should_not
be_nil
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment