Sha256: cfb7ae4663e03b10e09830cca197d1e64826391092202eae6004de5fe6e9aa01

Contents?: true

Size: 1012 Bytes

Versions: 6

Compression:

Stored size: 1012 Bytes

Contents

require_relative "../../../test_helper"

class ContentTagsMarkdownTest < ActiveSupport::TestCase

  setup do
    @page = comfy_cms_pages(:default)
  end

  def test_init
    tag = ComfortableMexicanSofa::Content::Tag::Markdown.new(@page, "test")
    assert_equal "test", tag.identifier
  end

  def test_content
    frag = comfy_cms_fragments(:default)
    tag = ComfortableMexicanSofa::Content::Tag::Markdown.new(@page, frag.identifier)
    assert_equal frag,          tag.fragment
    assert_equal frag.content,  tag.content
  end

  def test_render
    frag = comfy_cms_fragments(:default)
    frag.update_column(:content, "**test**")
    tag = ComfortableMexicanSofa::Content::Tag::Markdown.new(@page, frag.identifier)
    assert_equal "<p><strong>test</strong></p>\n", tag.render
  end

  def test_render_unrenderable
    frag = comfy_cms_fragments(:default)
    tag = ComfortableMexicanSofa::Content::Tag::Markdown.new(@page, "#{frag.identifier}, render: false")
    assert_equal "", tag.render
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.8 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.7 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.6 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.5 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.4 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.3 test/lib/content/tags/markdown_test.rb