Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
296a8781
Commit
296a8781
authored
May 17, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add flagging tests to DiscussionContentView
parent
ce2308b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee
+26
-26
No files found.
common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee
View file @
296a8781
...
...
@@ -2,24 +2,26 @@ describe "DiscussionContentView", ->
beforeEach
->
setFixtures
"""
<div class="discussion-post">
<header>
<a data-tooltip="vote" data-role="discussion-vote" class="vote-btn discussion-vote discussion-vote-up" href="#">
<span class="plus-icon">+</span> <span class="votes-count-number">0</span></a>
<h1>Post Title</h1>
<p class="posted-details">
<a class="username" href="/courses/MITx/999/Robot_Super_Course/discussion/forum/users/1">robot</a>
<span title="2013-05-08T17:34:07Z" class="timeago">less than a minute ago</span>
</p>
</header>
<div class="post-body"><p>Post body.</p></div>
<div data-tooltip="Report Misuse" data-role="thread-flag" class="discussion-flag-abuse notflagged">
<i class="icon"></i><span class="flag-label">Report Misuse</span></div>
<div data-tooltip="pin this thread" data-role="thread-pin" class="admin-pin discussion-pin notpinned">
<i class="icon"></i><span class="pin-label">Pin Thread</span></div>
</div>
"""
(
"""
<div class="discussion-post">
<header>
<a data-tooltip="vote" data-role="discussion-vote" class="vote-btn discussion-vote discussion-vote-up" href="#">
<span class="plus-icon">+</span> <span class="votes-count-number">0</span></a>
<h1>Post Title</h1>
<p class="posted-details">
<a class="username" href="/courses/MITx/999/Robot_Super_Course/discussion/forum/users/1">robot</a>
<span title="2013-05-08T17:34:07Z" class="timeago">less than a minute ago</span>
</p>
</header>
<div class="post-body"><p>Post body.</p></div>
<div data-tooltip="Report Misuse" data-role="thread-flag" class="discussion-flag-abuse notflagged">
<i class="icon"></i><span class="flag-label">Report Misuse</span></div>
<div data-tooltip="pin this thread" data-role="thread-pin" class="admin-pin discussion-pin notpinned">
<i class="icon"></i><span class="pin-label">Pin Thread</span></div>
</div>
"""
)
@
thread
=
new
Thread
{
id
:
'01234567'
,
user_id
:
'567'
,
...
...
@@ -47,10 +49,9 @@ describe "DiscussionContentView", ->
@
thread
.
flagAbuse
()
expect
(
@
thread
.
get
'abuse_flaggers'
).
toEqual
[
'123'
,
'567'
]
it
'can be unflagged for abuse'
,
->
temp_array
=
[]
temp_array
.
push
(
window
.
user
.
get
(
'id'
))
@
thread
.
set
(
"abuse_flaggers"
,
temp_array
)
@
thread
.
unflagAbuse
()
expect
(
@
thread
.
get
'abuse_flaggers'
).
toEqual
[]
\ No newline at end of file
it
'can be unflagged for abuse'
,
->
temp_array
=
[]
temp_array
.
push
(
window
.
user
.
get
(
'id'
))
@
thread
.
set
(
"abuse_flaggers"
,
temp_array
)
@
thread
.
unflagAbuse
()
expect
(
@
thread
.
get
'abuse_flaggers'
).
toEqual
[]
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