Trog-Routes-HTML-rss-style.t 615 B

123456789101112131415161718192021
  1. #!/usr/bin/env perl
  2. use 5.040;
  3. use re '/aasx';
  4. use warnings FATAL => 'all';
  5. use Test::More;
  6. use FindBin::libs;
  7. require_ok('Trog::Routes::HTML') or BAIL_OUT("Can't find SUT");
  8. subtest 'rss_style' => sub {
  9. my $res = Trog::Routes::HTML::rss_style( { route => '/styles/rss-style.xsl', title => '<b>x</b>' } );
  10. my $body = join( '', @{ $res->[2] } );
  11. is( $res->[0], 200, 'renders' );
  12. like( $body, qr{<title><xsl:value-of[ ]select="rss/channel/title"/></title>}, 'with the title of the channel as its title' );
  13. unlike( $body, qr{<b>x</b>}, 'and not a title from the query' );
  14. };
  15. done_testing();