]> git.openstreetmap.org Git - rails.git/commitdiff
Split RichText text-to-html test
authorAnton Khorev <tony29@yandex.ru>
Tue, 25 Mar 2025 02:36:00 +0000 (05:36 +0300)
committerAnton Khorev <tony29@yandex.ru>
Tue, 25 Mar 2025 02:59:25 +0000 (05:59 +0300)
test/lib/rich_text_test.rb

index 63c70b0996f59520e9cde2d4702c5f1a3b16f064..d454c4728ba5daeb9dae9c433670e68715e216c5 100644 (file)
@@ -221,19 +221,23 @@ class RichTextTest < ActiveSupport::TestCase
     assert_equal 50, r.spam_score.round
   end
 
-  def test_text_to_html
+  def test_text_to_html_linkify
     r = RichText.new("text", "foo http://example.com/ bar")
     assert_html r do
       assert_select "a", 1
       assert_select "a[href='http://example.com/']", 1
       assert_select "a[rel='nofollow noopener noreferrer']", 1
     end
+  end
 
+  def test_text_to_html_email
     r = RichText.new("text", "foo example@example.com bar")
     assert_html r do
       assert_select "a", 0
     end
+  end
 
+  def test_text_to_html_escape
     r = RichText.new("text", "foo < bar & baz > qux")
     assert_html r do
       assert_select "p", "foo < bar & baz > qux"