TWMC: Add white label (Host header) testing
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / lib / Catty.pm
index 3479701..f9285d0 100644 (file)
@@ -84,6 +84,23 @@ sub die : Global {
     die "erk!";
 }
 
+sub name : Global {
+    my ($self, $c) = @_;
+
+    my $html = html( $c->config->{name}, "This is the die page" );
+    $c->response->content_type("text/html");
+    $c->response->output($html);
+}
+
+sub host : Global {
+    my ($self, $c) = @_;
+
+    my $host = $c->req->header('Host') || "<undef>";
+    my $html = html( $c->config->{name}, "Host: $host" );
+    $c->response->content_type("text/html");
+    $c->response->output($html);
+}
+
 sub html {
     my ( $title, $body ) = @_;
     return qq{