spec: fix fragile file specs

the filename may not match the display_name if the newly uploaded
attachment is not a root attachment

refs CNVS-14376

Change-Id: I9e108e9311157fd6b91230090f1b114109b67a7f
Reviewed-on: https://gerrit.instructure.com/38017
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
Jeremy Stanley 2014-07-22 16:09:23 -06:00
parent 5cc99e6a9f
commit 1c30417b20
2 changed files with 4 additions and 5 deletions

View File

@ -456,7 +456,6 @@ describe ContentTag do
tag.update_asset_name!
att.reload
att.filename.should == 'important title.txt'
att.display_name.should == 'important title.txt'
end

View File

@ -58,10 +58,10 @@ if Qti.migration_executable
@course.attachments.count.should == 4
dir = Canvas::Migration::MigratorHelper::QUIZ_FILE_DIRECTORY
@course.attachments.find_by_migration_id("prepend_test_f3e5ead7f6e1b25a46a4145100566821").full_path.should == "course files/#{dir}/#{@migration.id}/exam1/my_files/org1/images/image.png"
@course.attachments.find_by_migration_id("prepend_test_c16566de1661613ef9e5517ec69c25a1").full_path.should == "course files/#{dir}/#{@migration.id}/contact info.png"
@course.attachments.find_by_migration_id("prepend_test_4d348a246af616c7d9a7d403367c1a30").full_path.should == "course files/#{dir}/#{@migration.id}/exam1/my_files/org0/images/image.png"
@course.attachments.find_by_migration_id("prepend_test_d2b5ca33bd970f64a6301fa75ae2eb22").full_path.should == "course files/#{dir}/#{@migration.id}/image.png"
@course.attachments.find_by_migration_id("prepend_test_f3e5ead7f6e1b25a46a4145100566821").full_display_path.should == "course files/#{dir}/#{@migration.id}/exam1/my_files/org1/images/image.png"
@course.attachments.find_by_migration_id("prepend_test_c16566de1661613ef9e5517ec69c25a1").full_display_path.should == "course files/#{dir}/#{@migration.id}/contact info.png"
@course.attachments.find_by_migration_id("prepend_test_4d348a246af616c7d9a7d403367c1a30").full_display_path.should == "course files/#{dir}/#{@migration.id}/exam1/my_files/org0/images/image.png"
@course.attachments.find_by_migration_id("prepend_test_d2b5ca33bd970f64a6301fa75ae2eb22").full_display_path.should == "course files/#{dir}/#{@migration.id}/image.png"
end
it "should use expected file links in questions" do