+ assert_nil r.image_alt
+ end
+
+ def test_markdown_html_image_with_empty_src
+ r = RichText.new("markdown", "<img src='' alt='forgot src'>")
+ assert_nil r.image
+ assert_nil r.image_alt
+ end
+
+ def test_markdown_skip_html_image_with_empty_src
+ r = RichText.new("markdown", "<img src='' alt='forgot src'> <img src='https://example.com/next_img_element.png' alt='have src'>")
+ assert_equal "https://example.com/next_img_element.png", r.image
+ assert_equal "have src", r.image_alt
+ end
+
+ def test_markdown_html_image_without_src
+ r = RichText.new("markdown", "<img alt='totally forgot src'>")
+ assert_nil r.image
+ assert_nil r.image_alt
+ end
+
+ def test_markdown_skip_html_image_without_src
+ r = RichText.new("markdown", "<img alt='totally forgot src'> <img src='https://example.com/next_img_element.png' alt='have src'>")
+ assert_equal "https://example.com/next_img_element.png", r.image
+ assert_equal "have src", r.image_alt