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
82d2b78b
Commit
82d2b78b
authored
May 14, 2013
by
Your Name
Committed by
Jay Zoldak
May 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update jasmine tests
parent
71be3deb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
13 deletions
+34
-13
common/static/coffee/spec/discussion/content_spec.coffee
+8
-4
common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee
+25
-6
common/static/coffee/spec/discussion/view/response_comment_show_view_spec.coffee
+1
-3
No files found.
common/static/coffee/spec/discussion/content_spec.coffee
View file @
82d2b78b
...
...
@@ -37,12 +37,16 @@ describe 'All Content', ->
expect
(
@
content
.
get
'subscribed'
).
toEqual
true
it
'can be flagged for abuse'
,
->
@
content
.
flagAbuse
#temp_array = @content.get("abuse_flaggers")
#temp_array.push(window.user.get('id'))
#@content.set("abuse_flaggers",temp_array)
@
content
.
flagAbuse
()
expect
(
@
content
.
get
'abuse_flaggers'
).
toEqual
[
'123'
,
'567'
]
it
'can be unflagged for abuse'
,
->
temp_array
=
[]
temp_array
.
push
(
window
.
user
.
get
(
'id'
))
@
content
.
set
(
"abuse_flaggers"
,
temp_array
)
@
content
.
unflagAbuse
()
expect
(
@
content
.
get
'abuse_flaggers'
).
toEqual
[]
describe
'Comments'
,
->
beforeEach
->
@
comment1
=
new
Comment
{
id
:
'123'
}
...
...
common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee
View file @
82d2b78b
x
describe
"DiscussionContentView"
,
->
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="#">
...
...
@@ -19,10 +19,28 @@ xdescribe "DiscussionContentView", ->
<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'
,
course_id
:
'mitX/999/test'
,
body
:
'this is a thread'
,
created_at
:
'2013-04-03T20:08:39Z'
,
abuse_flaggers
:
[
'123'
]
roles
:
[]
}
@
view
=
new
DiscussionContentView
({
model
:
@
thread
})
it
'defines the tag'
,
->
expect
(
$
(
'#jasmine-fixtures'
)).
toExist
expect
(
@
view
.
tagName
).
toBeDefined
expect
(
@
view
.
el
.
tagName
.
toLowerCase
()).
toBe
'div'
it
"defines the class"
,
->
# spyOn @content, 'initialize'
myView
=
new
DiscussionContentView
(
new
Content
)
expect
(
myView
.
tagName
).
toBeDefined
()
expect
(
@
view
.
model
).
toBeDefined
();
it
'is tied to the model'
,
->
expect
(
@
view
.
model
).
toBeDefined
();
\ No newline at end of file
common/static/coffee/spec/discussion/view/response_comment_show_view_spec.coffee
View file @
82d2b78b
...
...
@@ -48,6 +48,4 @@ describe 'ResponseCommentShowView', ->
it
'produces the correct HTML'
,
->
@
view
.
render
()
expect
(
@
view
.
el
.
innerHTML
).
toContainHtml
"""
<div
"""
expect
(
@
view
.
el
.
innerHTML
).
toContain
(
'"discussion-flag-abuse notflagged"'
)
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