Sha256: af83db603e8fa2d2dc3ebb10bd7e9315c24957e8f3d7aeb0519aa611ef765252
Contents?: true
Size: 1006 Bytes
Versions: 15
Compression:
Stored size: 1006 Bytes
Contents
require File.expand_path('../../test_helper', File.dirname(__FILE__)) class PageDateTimeTest < ActiveSupport::TestCase def test_initialize_tag [ '{{ cms:page:content:datetime }}', '{{cms:page:content:datetime}}' ].each do |tag_signature| assert tag = CmsTag::PageDateTime.initialize_tag(cms_pages(:default), tag_signature) assert_equal 'content', tag.label end end def test_initialize_tag_failure [ '{{cms:page:content:not_datetime}}', '{{cms:page:content}}', '{{cms:not_page:content}}', '{not_a_tag}' ].each do |tag_signature| assert_nil CmsTag::PageDateTime.initialize_tag(cms_pages(:default), tag_signature) end end def test_content_and_render tag = CmsTag::PageDateTime.initialize_tag(cms_pages(:default), '{{cms:page:content:datetime}}') assert tag.content.blank? time = 2.days.ago tag.content = time assert_equal time, tag.content assert_equal time.to_s, tag.render end end
Version data entries
15 entries across 15 versions & 1 rubygems