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
441680d5
Commit
441680d5
authored
Nov 29, 2012
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Bringing in Arjun's changes.
parents
0dcd4d73
af7c7190
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
lib/helpers.rb
+3
-1
spec/api/comment_thread_spec.rb
+1
-1
spec/spec_helper.rb
+3
-0
No files found.
lib/helpers.rb
View file @
441680d5
...
...
@@ -84,7 +84,9 @@ helpers do
end
def
handle_threads_query
(
comment_threads
)
comment_threads
=
comment_threads
.
where
(
:course_id
=>
params
[
:course_id
])
if
params
[
:course_id
]
comment_threads
=
comment_threads
.
where
(
:course_id
=>
params
[
:course_id
])
end
if
CommentService
.
config
[
:cache_enabled
]
query_params
=
params
.
slice
(
*
%w[course_id commentable_id sort_key sort_order page per_page user_id]
)
memcached_key
=
"threads_query_
#{
query_params
.
hash
}
"
...
...
spec/api/comment_thread_spec.rb
View file @
441680d5
...
...
@@ -62,7 +62,7 @@ describe "app" do
changed_thread
=
CommentThread
.
find
(
thread
.
id
)
changed_thread
.
body
.
should
==
"new body"
changed_thread
.
title
.
should
==
"new title"
changed_thread
.
commentable_id
.
should
==
"new
commentable_id"
changed_thread
.
commentable_id
.
should
==
"new
_
commentable_id"
end
it
"returns 400 when the thread does not exist"
do
put
"/api/v1/threads/does_not_exist"
,
body:
"new body"
,
title:
"new title"
...
...
spec/spec_helper.rb
View file @
441680d5
...
...
@@ -20,6 +20,9 @@ end
RSpec
.
configure
do
|
config
|
config
.
include
Rack
::
Test
::
Methods
config
.
treat_symbols_as_metadata_keys_with_true_values
=
true
config
.
filter_run
focus:
true
config
.
run_all_when_everything_filtered
=
true
end
Mongoid
.
configure
do
|
config
|
...
...
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