Sha256: cf0326b33e1142770846df0d50f442855d53a7a8a554fd782c5aa4f9b9bacb62
Contents?: true
Size: 1.01 KB
Versions: 22
Compression:
Stored size: 1.01 KB
Contents
require File.expand_path('../../test_helper', File.dirname(__FILE__)) class SnippetTest < ActiveSupport::TestCase def test_initialize_tag [ '{{ cms:snippet:label }}', '{{cms:snippet:label}}' ].each do |tag_signature| assert tag = CmsTag::Snippet.initialize_tag(cms_pages(:default), tag_signature) assert_equal 'label', tag.slug end end def test_initialize_tag_failure [ '{{cms:snippet}}', '{{cms:not_snippet:label}}', '{not_a_tag}' ].each do |tag_signature| assert_nil CmsTag::Snippet.initialize_tag(cms_pages(:default), tag_signature) end end def test_content_and_render tag = CmsTag::Snippet.initialize_tag(cms_pages(:default), '{{cms:snippet:default}}') assert_equal 'default_snippet_content', tag.content assert_equal 'default_snippet_content', tag.render tag = CmsTag::Snippet.initialize_tag(cms_pages(:default), "{{cms:snippet:doesnot_exist}}") assert_equal nil, tag.content assert_equal '', tag.render end end
Version data entries
22 entries across 22 versions & 1 rubygems