We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7177e7 commit 6ca0ee5Copy full SHA for 6ca0ee5
t/assets.t
@@ -0,0 +1,28 @@
1
+use strict;
2
+use warnings;
3
+use Test::More;
4
+use MetaCPAN::Web::Test qw( app GET test_psgi tx );
5
+
6
+test_psgi app, sub {
7
+ my $cb = shift;
8
+ {
9
+ ok( my $res = $cb->( GET '/' ), 'GET /' );
10
+ is( $res->code, 200, 'code 200' );
11
12
+ my $xpc = tx($res)->xpc;
13
14
+ my @assets = grep m{^/}, map $_->value,
15
+ $xpc->findnodes(q[//script/@src]),
16
+ $xpc->findnodes(q[//link[@rel="stylesheet"]/@href]);
17
18
+ ok( ( grep /\.js$/, @assets ), 'assets include a js file' );
19
+ ok( ( grep /\.css$/, @assets ), 'assets include a css file' );
20
21
+ for my $asset (@assets) {
22
+ ok( my $res = $cb->( GET $asset ), "GET $asset" );
23
24
+ }
25
26
+};
27
28
+done_testing;
0 commit comments