Sfoglia il codice sorgente

I have a failing test now yay

George S. Baugh 5 anni fa
parent
commit
483e6b4e7c
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      t/www-server.psgi.t

+ 11 - 2
t/www-server.psgi.t

@@ -13,5 +13,14 @@ require "$FindBin::Bin/../www/server.psgi" or die 'Could not require server.psgi
 
 my $test = Plack::Test->create($tcms::app);
 
-my $res = $test->request(HEAD "/");
-diag explain [$tcms::app],$res;
+#TODO Need a testing routing table which I can dynamically include -- a testing theme is probably the way
+
+subtest "HEAD requests handled correctly" => sub {
+    my $res = $test->request(HEAD "/");
+    cmp_ok($res->header('content-length'), '>', 0, "Headers sent correctly");
+    is($res->code, 200, "Return code returned as expected");
+    is($res->content, '', "No content actually returned by HEAD request");
+};
+
+
+done_testing();