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
c0141062
Commit
c0141062
authored
May 02, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jasmine test for changedMetadata method.
parent
c7713b62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
cms/static/coffee/spec/views/module_edit_spec.coffee
+11
-0
cms/templates/widgets/metadata-edit.html
+2
-2
No files found.
cms/static/coffee/spec/views/module_edit_spec.coffee
View file @
c0141062
...
...
@@ -72,3 +72,14 @@ describe "CMS.Views.ModuleEdit", ->
it
"loads the .xmodule-display inside the module editor"
,
->
expect
(
XModule
.
loadModule
).
toHaveBeenCalled
()
expect
(
XModule
.
loadModule
.
mostRecentCall
.
args
[
0
]).
toBe
(
$
(
'.xmodule_display'
))
describe
"changedMetadata"
,
->
it
"returns empty if no metadata loaded"
,
->
expect
(
@
moduleEdit
.
changedMetadata
()).
toEqual
({})
it
"returns only changed values"
,
->
@
moduleEdit
.
originalMetadata
=
{
'foo'
,
'bar'
}
spyOn
(
@
moduleEdit
,
'metadata'
).
andReturn
({
'a'
:
''
,
'b'
:
'before'
,
'c'
:
''
})
@
moduleEdit
.
loadEdit
()
@
moduleEdit
.
metadata
.
andReturn
({
'a'
:
''
,
'b'
:
'after'
,
'd'
:
'only_after'
})
expect
(
@
moduleEdit
.
changedMetadata
()).
toEqual
({
'b'
:
'after'
,
'd'
:
'only_after'
})
cms/templates/widgets/metadata-edit.html
View file @
c0141062
...
...
@@ -22,8 +22,8 @@
value=
'${field_value["field"].to_json(field_value["value"])}'
%
endif
size=
'60'
/>
## Change to
Fals
e to see all the information being passed through.
% if
Tru
e:
## Change to
Tru
e to see all the information being passed through.
% if
Fals
e:
<label>
Help: ${field_value['field'].help}
</label>
<label>
Type: ${type(field_value['field']).__name__}
</label>
<label>
Inherited: ${field_value['is_inherited']}
</label>
...
...
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