Add a blank richtext description method
This commit is contained in:
parent
4c00c57c0b
commit
097a414b22
2 changed files with 13 additions and 2 deletions
|
@ -57,6 +57,10 @@ module RichText
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def description
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def simple_format(text)
|
def simple_format(text)
|
||||||
|
|
|
@ -250,16 +250,18 @@ class RichTextTest < ActiveSupport::TestCase
|
||||||
assert_equal 141, r.spam_score.round
|
assert_equal 141, r.spam_score.round
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_text_no_image
|
def test_text_no_opengraph_properties
|
||||||
r = RichText.new("text", "foo https://example.com/ bar")
|
r = RichText.new("text", "foo https://example.com/ bar")
|
||||||
assert_nil r.image
|
assert_nil r.image
|
||||||
assert_nil r.image_alt
|
assert_nil r.image_alt
|
||||||
|
assert_nil r.description
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_html_no_image
|
def test_html_no_opengraph_properties
|
||||||
r = RichText.new("html", "foo <a href='https://example.com/'>bar</a> baz")
|
r = RichText.new("html", "foo <a href='https://example.com/'>bar</a> baz")
|
||||||
assert_nil r.image
|
assert_nil r.image
|
||||||
assert_nil r.image_alt
|
assert_nil r.image_alt
|
||||||
|
assert_nil r.description
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_markdown_no_image
|
def test_markdown_no_image
|
||||||
|
@ -328,6 +330,11 @@ class RichTextTest < ActiveSupport::TestCase
|
||||||
assert_equal "have src", r.image_alt
|
assert_equal "have src", r.image_alt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_markdown_no_description
|
||||||
|
r = RichText.new("markdown", "#Nope")
|
||||||
|
assert_nil r.description
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def assert_html(richtext, &block)
|
def assert_html(richtext, &block)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue