don't rename every text header when you rename one; fixes #9373
text headers do not correspond to a database row; all have a content_id of 0. recent change to allow items to appear in multiple modules did not take this into account, and treats all text headers as instances of the same thing. the same thing applies to external tools and external urls-- renaming one would rename all. test plan: * find or create a module with multiple text headers. * rename one. * the others should not change. * repeat the above with external tools. * repeat the above with external URLs. Change-Id: I063c0e5a769c8bdefd1dbda569b983506add971d Reviewed-on: https://gerrit.instructure.com/12295 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Brian Palmer <brianp@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
parent
684971ce71
commit
7290ff6470
|
@ -672,7 +672,9 @@ define([
|
|||
var $module = $("#context_module_" + data.content_tag.context_module_id);
|
||||
var $item = modules.addItemToModule($module, data.content_tag);
|
||||
$module.find(".context_module_items").sortable('refresh');
|
||||
modules.updateAllItemInstances(data.content_tag);
|
||||
if (data.content_tag.content_id != 0) {
|
||||
modules.updateAllItemInstances(data.content_tag);
|
||||
}
|
||||
modules.updateAssignmentData();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
|
|
|
@ -225,6 +225,40 @@ describe "context_modules" do
|
|||
@assignment.context_module_tags.each { |tag| tag.title.should == 'again' }
|
||||
end
|
||||
|
||||
it "should not rename every text header when you rename one" do
|
||||
add_module('TestModule')
|
||||
|
||||
# add a text header
|
||||
driver.find_element(:css, '.add_module_item_link').click
|
||||
select_module_item('#add_module_item_select', 'Text Header')
|
||||
wait_for_ajaximations
|
||||
title_input = find_with_jquery('input[name="title"]:visible')
|
||||
replace_content(title_input, 'First text header')
|
||||
driver.find_element(:css, '.add_item_button').click
|
||||
wait_for_ajaximations
|
||||
tag1 = ContentTag.last
|
||||
|
||||
# and another one
|
||||
driver.find_element(:css, '.add_module_item_link').click
|
||||
select_module_item('#add_module_item_select', 'Text Header')
|
||||
wait_for_ajaximations
|
||||
title_input = find_with_jquery('input[name="title"]:visible')
|
||||
replace_content(title_input, 'Second text header')
|
||||
driver.find_element(:css, '.add_item_button').click
|
||||
wait_for_ajaximations
|
||||
tag2 = ContentTag.last
|
||||
|
||||
# rename the second
|
||||
item2 = driver.find_element(:id, "context_module_item_#{tag2.id}")
|
||||
edit_module_item(item2) do |edit_form|
|
||||
replace_content(edit_form.find_element(:id, 'content_tag_title'), 'Renamed!')
|
||||
end
|
||||
|
||||
# verify the first did not change
|
||||
item1 = driver.find_element(:id, "context_module_item_#{tag1.id}")
|
||||
item1.should_not include_text('Renamed!')
|
||||
end
|
||||
|
||||
it "should add a quiz to a module" do
|
||||
add_existing_module_item('#quizs_select', 'Quiz', @quiz.title)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue