summaryrefslogtreecommitdiff
path: root/test/models
diff options
context:
space:
mode:
Diffstat (limited to 'test/models')
-rw-r--r--test/models/helpers/content_helper_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/models/helpers/content_helper_test.rb b/test/models/helpers/content_helper_test.rb
index c69ef4ed..40803633 100644
--- a/test/models/helpers/content_helper_test.rb
+++ b/test/models/helpers/content_helper_test.rb
@@ -125,4 +125,16 @@ class ContentHelperTest < ActionView::TestCase
125 assert_match "Document A", result 125 assert_match "Document A", result
126 assert_match "Document B", result 126 assert_match "Document B", result
127 end 127 end
128
129 test "aggregate? keeps the anchor attributes the editor is allowed to author" do
130 html = %(<p><a href="https://example.org" target="_blank" rel="noopener" ) +
131 %(title="Beispiel" data-gallery="g1">x</a></p>)
132
133 out = aggregate?(html)
134
135 assert_includes out, 'target="_blank"'
136 assert_includes out, 'rel="noopener"'
137 assert_includes out, 'title="Beispiel"'
138 assert_includes out, 'data-gallery="g1"'
139 end
128end 140end