diff --git a/cms/djangoapps/contentstore/features/problem-editor.feature b/cms/djangoapps/contentstore/features/problem-editor.feature index 43131596cf..001ca09dcb 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.feature +++ b/cms/djangoapps/contentstore/features/problem-editor.feature @@ -13,6 +13,12 @@ Feature: Problem Editor Then I can modify the display name 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 Given I have created a Blank Common Problem And I edit and select Settings @@ -59,4 +65,3 @@ Feature: Problem Editor Given I have created a LaTeX Problem And I edit and select Settings Then Edit High Level Source is visible - diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index ade1f07b2d..67367df477 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -41,6 +41,16 @@ def my_display_name_change_is_persisted_on_save(step): world.save_component_and_reopen(step) 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') def can_revert_display_name_to_unset(step): world.revert_setting_entry(DISPLAY_NAME) @@ -142,6 +152,9 @@ def verify_modified_randomization(): def verify_modified_display_name(): 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(): world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME), DISPLAY_NAME, '', False) diff --git a/cms/static/coffee/spec/main_spec.coffee b/cms/static/coffee/spec/main_spec.coffee index 9383f2547e..cee591642e 100644 --- a/cms/static/coffee/spec/main_spec.coffee +++ b/cms/static/coffee/spec/main_spec.coffee @@ -27,7 +27,7 @@ describe "AJAX Errors", -> tpl = readFixtures('system-feedback.underscore') beforeEach -> - setFixtures($("