]> git.openstreetmap.org Git - rails.git/commitdiff
Add tests for richtext table classes
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 24 Mar 2021 17:55:15 +0000 (17:55 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 24 Mar 2021 17:55:15 +0000 (17:55 +0000)
test/lib/rich_text_test.rb

index 80cf0ae37e30c3fa293e9aae862c2ea6f63300b1..e287f03f5fe5a540d401d30aacda65cc6bc70022 100644 (file)
@@ -47,6 +47,11 @@ class RichTextTest < ActiveSupport::TestCase
       assert_select "style", false
       assert_select "p", /^foo *baz$/
     end
+
+    r = RichText.new("html", "<table><tr><td>column</td></tr></table>")
+    assert_html r do
+      assert_select "table[class='table table-sm w-auto']"
+    end
   end
 
   def test_html_to_text
@@ -145,6 +150,11 @@ class RichTextTest < ActiveSupport::TestCase
     assert_html r do
       assert_select "pre", /^\s*foo bar baz\s*$/
     end
+
+    r = RichText.new("markdown", "|column|column")
+    assert_html r do
+      assert_select "table[class='table table-sm w-auto']"
+    end
   end
 
   def test_markdown_to_text