sub sitemap : Path('/sitemap') {
my ( $self, $c ) = @_;
- $c->res->body( $c->sitemap );
+ $c->res->body( $c->sitemap->xml );
}
-sub alone :Path('/alone') :Sitemap { }
+sub alone :Local :Sitemap { }
-sub with_priority :Path('/with_priority') :Sitemap(0.75) { }
+sub with_priority :Local :Sitemap(0.75) { }
-sub with_function :Path('/with_function') :Sitemap(*) { }
+sub with_function :Local :Sitemap(*) { }
sub with_function_sitemap {
- $_[2]->add( 'http://localhost/with_function' );
+ $_[2]->add( 'http://localhost/root/with_function' );
}
-sub with_args :Path('/with_args')
+sub with_args :Local
:Sitemap( lastmod => 2010-09-27, changefreq => daily )
{}
my $xml = request('/sitemap')->content;
+diag $xml;
+
$xml =~ s/\s+//g;
-like $xml, qr{<url><loc>http://localhost/alone</loc></url>}, ':Sitemap';
-like $xml, qr{<url><loc>http://localhost/with_function</loc></url>},
+like $xml, qr{<url><loc>http://localhost/root/alone</loc></url>}, ':Sitemap';
+like $xml, qr{<url><loc>http://localhost/root/with_function</loc></url>},
':Sitemap(*)';
like $xml,
- qr{<url><loc>http://localhost/with_priority</loc><priority>0.75</priority></url>},
+ qr{<url><loc>http://localhost/root/with_priority</loc><priority>0.75</priority></url>},
':Sitemap(0.75)';
like $xml,
- qr{<url><loc>http://localhost/with_args</loc><lastmod>2010-09-27</lastmod><changefreq>daily</changefreq></url>},
+ qr{<url><loc>http://localhost/root/with_args</loc><lastmod>2010-09-27</lastmod><changefreq>daily</changefreq></url>},
':Sitemap(lotsa stuff)';