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
088497a1
Commit
088497a1
authored
Nov 06, 2013
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70 from edx/gprice/content-type-json
Fix Content-Type header
parents
d3ba8bfe
1343ca1e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
CHANGELOG.rst
+2
-0
app.rb
+4
-0
spec/api/comment_spec.rb
+6
-0
spec/api/comment_thread_spec.rb
+7
-0
No files found.
CHANGELOG.rst
View file @
088497a1
...
@@ -5,6 +5,8 @@ These are notable changes in cs_comments_service. This is a rolling list of cha
...
@@ -5,6 +5,8 @@ These are notable changes in cs_comments_service. This is a rolling list of cha
in roughly chronological order, most recent first. Add your entries at or near
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
the top. Include a label indicating the component affected.
**app.rb:** Return the correct Content-Type, application/json.
**api:** Add the ability to filter by commentable id to more endpoints
**api:** Add the ability to filter by commentable id to more endpoints
(in particular, /threads).
(in particular, /threads).
...
...
app.rb
View file @
088497a1
...
@@ -66,6 +66,10 @@ if RACK_ENV.to_s != "test" # disable api_key auth in test environment
...
@@ -66,6 +66,10 @@ if RACK_ENV.to_s != "test" # disable api_key auth in test environment
end
end
end
end
before
do
content_type
"application/json"
end
if
ENV
[
"ENABLE_IDMAP_LOGGING"
]
if
ENV
[
"ENABLE_IDMAP_LOGGING"
]
after
do
after
do
...
...
spec/api/comment_spec.rb
View file @
088497a1
...
@@ -4,6 +4,12 @@ describe "app" do
...
@@ -4,6 +4,12 @@ describe "app" do
describe
"comments"
do
describe
"comments"
do
before
(
:each
)
{
init_without_subscriptions
}
before
(
:each
)
{
init_without_subscriptions
}
describe
"GET /api/v1/comments/:comment_id"
do
describe
"GET /api/v1/comments/:comment_id"
do
it
"returns JSON"
do
comment
=
Comment
.
first
get
"/api/v1/comments/
#{
comment
.
id
}
"
last_response
.
should
be_ok
last_response
.
content_type
.
should
==
"application/json;charset=utf-8"
end
it
"retrieve information of a single comment"
do
it
"retrieve information of a single comment"
do
comment
=
Comment
.
first
comment
=
Comment
.
first
get
"/api/v1/comments/
#{
comment
.
id
}
"
get
"/api/v1/comments/
#{
comment
.
id
}
"
...
...
spec/api/comment_thread_spec.rb
View file @
088497a1
...
@@ -308,6 +308,13 @@ describe "app" do
...
@@ -308,6 +308,13 @@ describe "app" do
before
(
:each
)
{
init_without_subscriptions
}
before
(
:each
)
{
init_without_subscriptions
}
it
"returns JSON"
do
thread
=
CommentThread
.
first
get
"/api/v1/threads/
#{
thread
.
id
}
"
last_response
.
should
be_ok
last_response
.
content_type
.
should
==
"application/json;charset=utf-8"
end
it
"get information of a single comment thread"
do
it
"get information of a single comment thread"
do
thread
=
CommentThread
.
first
thread
=
CommentThread
.
first
get
"/api/v1/threads/
#{
thread
.
id
}
"
get
"/api/v1/threads/
#{
thread
.
id
}
"
...
...
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