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
6ae0add9
Commit
6ae0add9
authored
Nov 16, 2012
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the new problem create statements in the describe blocks for the capa display spec.
parent
718ce4db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
common/lib/xmodule/xmodule/js/fixtures/problem.html
+3
-1
common/lib/xmodule/xmodule/js/fixtures/xmodule.html
+8
-0
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
+18
-14
No files found.
common/lib/xmodule/xmodule/js/fixtures/problem.html
View file @
6ae0add9
<section
id=
"problem_1"
class=
"problems-wrapper"
data-url=
"/problem/url/"
></section>
<section
id=
"problem_1"
class=
"problems-wrapper"
data-url=
"/problem/url/"
data-problem-id=
"i4x://edX/101/problem/Quiz"
></section>
\ No newline at end of file
common/lib/xmodule/xmodule/js/fixtures/xmodule.html
0 → 100644
View file @
6ae0add9
<section
class=
'xmodule_display xmodule_CapaModule'
data-type=
'Problem'
>
<section
id=
'problem_101'
class=
'problems-wrapper'
data-problem-id=
'i4x://edX/101/problem/Problem101'
data-url=
'/problem/Problem101/'
>
</section>
</section>
\ No newline at end of file
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
View file @
6ae0add9
...
...
@@ -13,14 +13,16 @@ describe 'Problem', ->
# note that the fixturesPath is set in spec/helper.coffee
loadFixtures
'problem.html'
loadFixtures
'xmodule.html'
spyOn
Logger
,
'log'
spyOn
(
$
.
fn
,
'load'
).
andCallFake
(
url
,
callback
)
->
$
(
@
).
html
readFixtures
(
'problem_content.html'
)
callback
()
describe
'constructor'
,
->
beforeEach
->
@
problem
=
new
Problem
(
"
it
'set the element from html'
,
->
@
problem999
=
new
Problem
(
"
<section class='xmodule_display xmodule_CapaModule' data-type='Problem'>
<section id='problem_999'
class='problems-wrapper'
...
...
@@ -28,16 +30,18 @@ describe 'Problem', ->
data-url='/problem/quiz/'>
</section>
</section>
"
)
"
)
expect
(
@
problem999
.
element_id
).
toBe
'problem_999'
it
'set the element'
,
->
expect
(
@
problem
.
element_id
).
toBe
'problem_999'
it
'set the element from loadFixtures'
,
->
@
problem101
=
new
Problem
(
$
(
'.xmodule_display'
))
expect
(
@
problem101
.
element_id
).
toBe
'problem_101'
describe
'bind'
,
->
beforeEach
->
spyOn
window
,
'update_schematics'
MathJax
.
Hub
.
getAllJax
.
andReturn
[
@
stubbedJax
]
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
it
'set mathjax typeset'
,
->
expect
(
MathJax
.
Hub
.
Queue
).
toHaveBeenCalled
()
...
...
@@ -71,7 +75,7 @@ describe 'Problem', ->
describe
'render'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
bind
=
@
problem
.
bind
spyOn
@
problem
,
'bind'
...
...
@@ -99,7 +103,7 @@ describe 'Problem', ->
describe
'check'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
problem
.
answers
=
'foo=1&bar=2'
it
'log the problem_check event'
,
->
...
...
@@ -132,7 +136,7 @@ describe 'Problem', ->
describe
'reset'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
it
'log the problem_reset event'
,
->
@
problem
.
answers
=
'foo=1&bar=2'
...
...
@@ -152,7 +156,7 @@ describe 'Problem', ->
describe
'show'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
problem
.
el
.
prepend
'<div id="answer_1_1" /><div id="answer_1_2" />'
describe
'when the answer has not yet shown'
,
->
...
...
@@ -231,7 +235,7 @@ describe 'Problem', ->
describe
'save'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
problem
.
answers
=
'foo=1&bar=2'
it
'log the problem_save event'
,
->
...
...
@@ -251,7 +255,7 @@ describe 'Problem', ->
describe
'refreshMath'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
$
(
'#input_example_1'
).
val
'E=mc^2'
@
problem
.
refreshMath
target
:
$
(
'#input_example_1'
).
get
(
0
)
...
...
@@ -261,7 +265,7 @@ describe 'Problem', ->
describe
'updateMathML'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
stubbedJax
.
root
.
toMathML
.
andReturn
'<MathML>'
describe
'when there is no exception'
,
->
...
...
@@ -281,7 +285,7 @@ describe 'Problem', ->
describe
'refreshAnswers'
,
->
beforeEach
->
@
problem
=
new
Problem
1
,
"problem_1"
,
"/problem/url/"
@
problem
=
new
Problem
(
$
(
'.xmodule_display'
))
@
problem
.
el
.
html
'''
<textarea class="CodeMirror" />
<input id="input_1_1" name="input_1_1" class="schematic" value="one" />
...
...
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