summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-02 14:32:02 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-02 14:32:02 +0200
commit39ebecace66ce36f4a896fefb86814dde042577f (patch)
tree57455665cea2a89b4370be7a21e5a9cbf460fe33 /test
parentdc1daad693221b2573a0cf62392b8d0b100bb430 (diff)
Test that aggregate? keeps the attributes the editor permits
Diffstat (limited to 'test')
-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