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
d97e87ff
Commit
d97e87ff
authored
Jul 28, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api for getting all tags
parent
9f5e409f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app.rb
+4
-0
spec/comment_thread_spec.rb
+14
-0
No files found.
app.rb
View file @
d97e87ff
...
...
@@ -41,6 +41,10 @@ post '/api/v1/:commentable_id/threads' do |commentable_id|
thread
.
to_hash
.
to_json
end
get
'/api/v1/threads/tags'
do
CommentThread
.
tags
.
to_json
end
get
'/api/v1/threads/:thread_id'
do
|
thread_id
|
thread
.
to_hash
(
recursive:
params
[
"recursive"
]).
to_json
end
...
...
spec/comment_thread_spec.rb
View file @
d97e87ff
...
...
@@ -119,4 +119,18 @@ describe "app" do
end
end
end
describe
"GET /api/v1/threads/tags"
do
it
"get all tags used in threads"
do
thread1
=
CommentThread
.
all
.
to_a
.
first
thread2
=
CommentThread
.
all
.
to_a
.
last
thread1
.
tags
=
"a, b, c"
thread1
.
save
thread2
.
tags
=
"d, e, f"
thread2
.
save
get
"/api/v1/threads/tags"
last_response
.
should
be_ok
tags
=
parse
last_response
.
body
tags
.
length
.
should
==
6
end
end
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