From 388d892d216c3651112464803d50b38ad49e0e73 Mon Sep 17 00:00:00 2001 From: James Williams Date: Fri, 7 Sep 2018 07:19:40 -0600 Subject: [PATCH] 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 QA-Review: Mysti Sadler Product-Review: James Williams --- lib/imported_html_converter.rb | 2 +- spec/models/content_migration/course_copy_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/imported_html_converter.rb b/lib/imported_html_converter.rb index 919a1d75038..fcd77921756 100644 --- a/lib/imported_html_converter.rb +++ b/lib/imported_html_converter.rb @@ -23,7 +23,7 @@ class ImportedHtmlConverter include HtmlTextHelper 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 diff --git a/spec/models/content_migration/course_copy_spec.rb b/spec/models/content_migration/course_copy_spec.rb index cfa7dbe1282..1246bdd3f19 100644 --- a/spec/models/content_migration/course_copy_spec.rb +++ b/spec/models/content_migration/course_copy_spec.rb @@ -608,6 +608,17 @@ describe ContentMigration do expect(@copy_to.reload.syllabus_body).to include "/courses/#{@copy_to.id}/files/#{att2.id}/download" end + it "should copy weird longdesc things" do + page = @copy_from.wiki_pages.create!(:title => "page") + @copy_from.syllabus_body = "" + @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 expect { media_id = '0_deadbeef'