Sha256: 2d15efa49e13e718375aec2e3a64ad2afa0a85b0e1b5d2d46ed93c977ef90104

Contents?: true

Size: 1.42 KB

Versions: 8

Compression:

Stored size: 1.42 KB

Contents

require 'webgen/test'
require 'webgen/node'

class SitemapTagTest < Webgen::TagTestCase

  plugin_files [
    'webgen/plugins/tags/sitemap.rb',
    'webgen/plugins/filehandlers/directory.rb',
    'webgen/plugins/filehandlers/page.rb',
  ]
  plugin_to_test 'Tag/Sitemap'


  def test_process_tag
    root = @manager['Core/FileHandler'].instance_eval { build_tree }

    node = root.resolve_node( 'file1.en.page' )
    assert_equal( '<ul><li><a href="dir1/">Dir1</a><ul><li><a href="dir1/dir11/index.html">Dir11</a>' +
                  '<ul><li><a href="dir1/dir11/file111.html">File111</a></li></ul></li>' +
                  '<li><a href="dir1/file11.html">File11</a></li></ul></li>' +
                  '<li><a href="dir2/">Dir2</a><ul><li><a href="dir2/file21.html">File21</a></li></ul></li></ul>',
                  @plugin.process_tag( 'sitemap', [node] ) )

    set_config( 'honorInMenu' => false )
    assert_equal( '<ul><li><a href="dir1/">Dir1</a><ul><li><a href="dir1/dir11/index.html">Dir11</a>' +
                  '<ul><li><a href="dir1/dir11/file111.html">File111</a></li></ul></li>' +
                  '<li><a href="dir1/file11.html">File11</a></li></ul></li>' +
                  '<li><a href="dir2/">Dir2</a><ul><li><a href="dir2/file21.html">File21</a></li></ul></li>' +
                  '<li><span>File1</span></li><li><a href="index.html">Index</a></li></ul>',
                  @plugin.process_tag( 'sitemap', [node] ) )
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webgen-0.4.0 test/unittests/tc_tags_sitemap.rb
webgen-0.4.1 test/unittests/tc_tags_sitemap.rb
webgen-0.4.2 test/unittests/tc_tags_sitemap.rb
webgen-0.4.4 test/unittests/tc_tags_sitemap.rb
webgen-0.4.3 test/unittests/tc_tags_sitemap.rb
webgen-0.4.5 test/unittests/tc_tags_sitemap.rb
webgen-0.4.6 test/unittests/tc_tags_sitemap.rb
webgen-0.4.7 test/unittests/tc_tags_sitemap.rb