Sha256: 3652535a036d270df5f71230fe178c8d0c56e004fb29ce1f5e0c4d7935221cfd

Contents?: true

Size: 1011 Bytes

Versions: 3

Compression:

Stored size: 1011 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

3 entries across 3 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.2 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.1 test/lib/content/tags/markdown_test.rb
comfortable_mexican_sofa-2.0.0 test/lib/content/tags/markdown_test.rb