Commit 7d07309f by cahrens

Don't call setFixtures. Can stomp on other tests.

parent 24707f8f
...@@ -13,6 +13,12 @@ Feature: Problem Editor ...@@ -13,6 +13,12 @@ Feature: Problem Editor
Then I can modify the display name Then I can modify the display name
And my display name change is persisted on save And my display name change is persisted on save
Scenario: User can specify special characters in String values
Given I have created a Blank Common Problem
And I edit and select Settings
Then I can specify special characters in the display name
And my special characters and persisted on save
Scenario: User can revert display name to unset Scenario: User can revert display name to unset
Given I have created a Blank Common Problem Given I have created a Blank Common Problem
And I edit and select Settings And I edit and select Settings
...@@ -59,4 +65,3 @@ Feature: Problem Editor ...@@ -59,4 +65,3 @@ Feature: Problem Editor
Given I have created a LaTeX Problem Given I have created a LaTeX Problem
And I edit and select Settings And I edit and select Settings
Then Edit High Level Source is visible Then Edit High Level Source is visible
...@@ -41,6 +41,16 @@ def my_display_name_change_is_persisted_on_save(step): ...@@ -41,6 +41,16 @@ def my_display_name_change_is_persisted_on_save(step):
world.save_component_and_reopen(step) world.save_component_and_reopen(step)
verify_modified_display_name() verify_modified_display_name()
@step('I can specify special characters in the display name')
def i_can_modify_the_display_name_with_special_chars(step):
world.get_setting_entry(DISPLAY_NAME).find_by_css('.setting-input')[0].fill("updated ' \" &")
verify_modified_display_name_with_special_chars()
@step('my special characters and persisted on save')
def special_chars_persisted_on_save(step):
world.save_component_and_reopen(step)
verify_modified_display_name_with_special_chars()
@step('I can revert the display name to unset') @step('I can revert the display name to unset')
def can_revert_display_name_to_unset(step): def can_revert_display_name_to_unset(step):
world.revert_setting_entry(DISPLAY_NAME) world.revert_setting_entry(DISPLAY_NAME)
...@@ -142,6 +152,9 @@ def verify_modified_randomization(): ...@@ -142,6 +152,9 @@ def verify_modified_randomization():
def verify_modified_display_name(): def verify_modified_display_name():
world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, 'modified', True) world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, 'modified', True)
def verify_modified_display_name_with_special_chars():
world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, "updated ' \" &", True)
def verify_unset_display_name(): def verify_unset_display_name():
world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '', False) world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '', False)
...@@ -27,7 +27,7 @@ describe "AJAX Errors", -> ...@@ -27,7 +27,7 @@ describe "AJAX Errors", ->
tpl = readFixtures('system-feedback.underscore') tpl = readFixtures('system-feedback.underscore')
beforeEach -> beforeEach ->
setFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(tpl)) appendSetFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(tpl))
appendSetFixtures(sandbox({id: "page-notification"})) appendSetFixtures(sandbox({id: "page-notification"}))
@requests = requests = [] @requests = requests = []
@xhr = sinon.useFakeXMLHttpRequest() @xhr = sinon.useFakeXMLHttpRequest()
......
tpl = readFixtures('system-feedback.underscore') tpl = readFixtures('system-feedback.underscore')
beforeEach -> beforeEach ->
setFixtures(sandbox({id: "page-alert"})) appendSetFixtures(sandbox({id: "page-alert"}))
appendSetFixtures(sandbox({id: "page-notification"})) appendSetFixtures(sandbox({id: "page-notification"}))
appendSetFixtures(sandbox({id: "page-prompt"})) appendSetFixtures(sandbox({id: "page-prompt"}))
appendSetFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(tpl)) appendSetFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(tpl))
......
...@@ -4,7 +4,7 @@ stringEntryTemplate = readFixtures('metadata-string-entry.underscore') ...@@ -4,7 +4,7 @@ stringEntryTemplate = readFixtures('metadata-string-entry.underscore')
optionEntryTemplate = readFixtures('metadata-option-entry.underscore') optionEntryTemplate = readFixtures('metadata-option-entry.underscore')
beforeEach -> beforeEach ->
setFixtures($("<script>", {id: "metadata-editor-tpl", type: "text/template"}).text(editorTemplate)) appendSetFixtures($("<script>", {id: "metadata-editor-tpl", type: "text/template"}).text(editorTemplate))
appendSetFixtures($("<script>", {id: "metadata-number-entry", type: "text/template"}).text(numberEntryTemplate)) appendSetFixtures($("<script>", {id: "metadata-number-entry", type: "text/template"}).text(numberEntryTemplate))
appendSetFixtures($("<script>", {id: "metadata-string-entry", type: "text/template"}).text(stringEntryTemplate)) appendSetFixtures($("<script>", {id: "metadata-string-entry", type: "text/template"}).text(stringEntryTemplate))
appendSetFixtures($("<script>", {id: "metadata-option-entry", type: "text/template"}).text(optionEntryTemplate)) appendSetFixtures($("<script>", {id: "metadata-option-entry", type: "text/template"}).text(optionEntryTemplate))
...@@ -178,7 +178,7 @@ describe "CMS.Views.Metadata.String is a basic string input with clear functiona ...@@ -178,7 +178,7 @@ describe "CMS.Views.Metadata.String is a basic string input with clear functiona
assertValueInView(@view, 'Word cloud') assertValueInView(@view, 'Word cloud')
it "can update its value in the view", -> it "can update its value in the view", ->
assertCanUpdateView(@view, "updated") assertCanUpdateView(@view, "updated ' \" &")
it "has a clear method to revert to the model default", -> it "has a clear method to revert to the model default", ->
assertClear(@view, 'default value') assertClear(@view, 'default value')
......
...@@ -4,7 +4,7 @@ describe "CMS.Views.ModuleEdit", -> ...@@ -4,7 +4,7 @@ describe "CMS.Views.ModuleEdit", ->
@stubModule.id = 'stub-id' @stubModule.id = 'stub-id'
setFixtures """ appendSetFixtures """
<li class="component" id="stub-id"> <li class="component" id="stub-id">
<div class="component-editor"> <div class="component-editor">
<div class="module-editor"> <div class="module-editor">
......
...@@ -29,7 +29,7 @@ describe "CMS.Views.SectionEdit", -> ...@@ -29,7 +29,7 @@ describe "CMS.Views.SectionEdit", ->
feedback_tpl = readFixtures('system-feedback.underscore') feedback_tpl = readFixtures('system-feedback.underscore')
beforeEach -> beforeEach ->
setFixtures($("<script>", {id: "section-name-edit-tpl", type: "text/template"}).text(tpl)) appendSetFixtures($("<script>", {id: "section-name-edit-tpl", type: "text/template"}).text(tpl))
appendSetFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(feedback_tpl)) appendSetFixtures($("<script>", {id: "system-feedback-tpl", type: "text/template"}).text(feedback_tpl))
spyOn(CMS.Views.SectionEdit.prototype, "switchToShowView") spyOn(CMS.Views.SectionEdit.prototype, "switchToShowView")
.andCallThrough() .andCallThrough()
......
...@@ -825,6 +825,3 @@ function saveSetSectionScheduleDate(e) { ...@@ -825,6 +825,3 @@ function saveSetSectionScheduleDate(e) {
hideModal(); hideModal();
}); });
} }
...@@ -40,4 +40,4 @@ ...@@ -40,4 +40,4 @@
<%include file="source-edit.html" /> <%include file="source-edit.html" />
% endif % endif
<div class="wrapper-comp-settings metadata_edit" id="settings-tab" data-metadata='${json.dumps(metadata_field_copy)}'/> <div class="wrapper-comp-settings metadata_edit" id="settings-tab" data-metadata='${json.dumps(metadata_field_copy) | h}'/>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment