Sha256: 952be10c1bf045d05f4034a2ea688363b497a99004e92272993e775832db0301

Contents?: true

Size: 813 Bytes

Versions: 2

Compression:

Stored size: 813 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))
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webgen-1.0.0.beta2 test/webgen/tag/test_meta_info.rb
webgen-1.0.0.beta1 test/webgen/tag/test_meta_info.rb