translate copied links in longdesc attributes

closes #ADMIN-1409

Change-Id: I5291355cb21246a638e71003c70dc131f7f6e8e2
Reviewed-on: https://gerrit.instructure.com/163522
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2018-09-07 07:19:40 -06:00
parent 154020c668
commit 388d892d21
2 changed files with 12 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class ImportedHtmlConverter
include HtmlTextHelper include HtmlTextHelper
CONTAINER_TYPES = ['div', 'p', 'body'] CONTAINER_TYPES = ['div', 'p', 'body']
LINK_ATTRS = ['rel', 'href', 'src', 'data', 'value'] LINK_ATTRS = ['rel', 'href', 'src', 'data', 'value', 'longdesc']
attr_reader :link_parser, :link_resolver, :link_replacer attr_reader :link_parser, :link_resolver, :link_replacer

View File

@ -608,6 +608,17 @@ describe ContentMigration do
expect(@copy_to.reload.syllabus_body).to include "/courses/#{@copy_to.id}/files/#{att2.id}/download" expect(@copy_to.reload.syllabus_body).to include "/courses/#{@copy_to.id}/files/#{att2.id}/download"
end end
it "should copy weird longdesc things" do
page = @copy_from.wiki_pages.create!(:title => "page")
@copy_from.syllabus_body = "<img longdesc=\"/courses/#{@copy_from.id}/pages/#{page.url}/>"
@copy_from.save!
run_course_copy
page2 = @copy_to.wiki_pages.where(:migration_id => mig_id(page)).first
expect(@copy_to.reload.syllabus_body).to include "/courses/#{@copy_to.id}/pages/#{page2.url}"
end
it "should re-use kaltura media objects" do it "should re-use kaltura media objects" do
expect { expect {
media_id = '0_deadbeef' media_id = '0_deadbeef'