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
b1530e11
Commit
b1530e11
authored
Feb 14, 2014
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #87 from edx/gprice/test_delete_sub_comment
Add test for sub-comment deletion
parents
d4b8bc99
58398c84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
spec/api/comment_spec.rb
+8
-0
No files found.
spec/api/comment_spec.rb
View file @
b1530e11
...
...
@@ -124,6 +124,14 @@ describe "app" do
Comment
.
count
.
should
==
prev_count
-
cnt_comments
Comment
.
all
.
select
{
|
c
|
c
.
id
==
comment
.
id
}.
first
.
should
be_nil
end
it
"can delete a sub comment"
do
parent
=
CommentThread
.
first
.
comments
.
first
sub_comment
=
parent
.
children
.
first
id
=
sub_comment
.
id
delete
"/api/v1/comments/
#{
id
}
"
Comment
.
where
(
:id
=>
id
).
should
be_empty
parent
.
children
.
where
(
:id
=>
id
).
should
be_empty
end
it
"returns 400 when the comment does not exist"
do
delete
"/api/v1/comments/does_not_exist"
last_response
.
status
.
should
==
400
...
...
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