Sha256: 93b16acb3a18e0747ee72f40bbe13492b675be761b3d9588cdbc072f4ec8de1c

Contents?: true

Size: 956 Bytes

Versions: 1

Compression:

Stored size: 956 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/test_helper'
require 'webgen/tag/meta_info'
require 'time'

class TestTagMetaInfo < MiniTest::Unit::TestCase

  include Webgen::TestHelper

  def test_call
    setup_context
    node = Webgen::Node.new(@website.tree.dummy_root, 'test', 'test', 'lang' => 'en', 'key' => 'value <br />')
    @context[:chain] = [node]

    @context[:config] = {'tag.meta_info.escape_html' => true}
    assert_equal("en", Webgen::Tag::MetaInfo.call('lang', '', @context))
    assert_equal("value &lt;br /&gt;", Webgen::Tag::MetaInfo.call('key', '', @context))
    assert_equal("", Webgen::Tag::MetaInfo.call('invalid', '', @context))

    @context[:config] = {'tag.meta_info.escape_html' => false}
    assert_equal("value <br />", Webgen::Tag::MetaInfo.call('key', '', @context))

    @context[:config] = {'tag.meta_info.mi' => 'key'}
    assert_equal("value <br />", Webgen::Tag::MetaInfo.call('meta_info', '', @context))
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webgen-1.0.0.beta3 test/webgen/tag/test_meta_info.rb