Sha256: 8aa0efd69ab134c5f4b4743b54cdc52b724b39274753534778b8eed7636e68b2

Contents?: true

Size: 827 Bytes

Versions: 1

Compression:

Stored size: 827 Bytes

Contents

# :nodoc: all

require "test/unit"

require "glue/logger"

require "nitro/sitemap"

class TC_N_SiteMap < Test::Unit::TestCase
	include N
	
	def setup
		$n0 = SitePage.new "/index.sx", "Joy", nil, realm = "main-realm"
		$n1 = SitePage.new "/id/index.sx", "Id", $n0
		$n2 = SitePage.new "/id/page.sx", "My page", $n1
		$n1 = SitePage.new "/id/login.sx", "Login", $n0	
	end

	def teardown
		$sitemap = nil
	end

	def test_all
		assert_equal(3, $sitemap.path("/id/page.sx").size())
		
		# bug: wrong order
		assert_equal("Joy > Id > My page", $sitemap.str_path("/id/page.sx"))
		
		# bug: wrong hrefs
		assert_equal('<a href="/index.sx">Joy</a> > <a href="/id/index.sx">Id</a> > My page', $sitemap.linked_path("/id/page.sx"))

		# bug: realm should be inherited from parent
		setup	
		assert_equal($n2.realm, $n1.realm)
	end
	
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.8.0 test/nitro/tc_sitemap.rb