Skip to content

A platform for community discussion. Free, open, simple.

DEV: Improve `PrettyText` spec to test for markdown image title attr.

Guo Xiang Tan799bd6280314
diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb
index 71da86ead13..0b9d317d890 100644
--- a/spec/components/pretty_text_spec.rb
+++ b/spec/components/pretty_text_spec.rb
@@ -1224,7 +1224,7 @@ HTML
![](http://png.com/my.png)
![|220x100](http://png.com/my.png)
![stuff](http://png.com/my.png)
- ![|220x100,50%](http://png.com/my.png)
+ ![|220x100,50%](http://png.com/my.png "some title")
MD
html = <<~HTML
@@ -1232,7 +1232,7 @@ HTML
<img src="http://png.com/my.png" alt><br>
<img src="http://png.com/my.png" alt width="220" height="100"><br>
<img src="http://png.com/my.png" alt="stuff"><br>
- <img src="http://png.com/my.png" alt width="110" height="50"></p>
+ <img src="http://png.com/my.png" alt title="some title" width="110" height="50"></p>
HTML
expect(cooked).to eq(html.strip)