Actually add the new bits for rearranged apps
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / lib / CattySession / Controller / Root.pm
diff --git a/t/lib/CattySession/Controller/Root.pm b/t/lib/CattySession/Controller/Root.pm
new file mode 100644 (file)
index 0000000..d83f0da
--- /dev/null
@@ -0,0 +1,47 @@
+package CattySession::Controller::Root;
+
+use strict;
+use warnings;
+
+use base qw/ Catalyst::Controller /;
+
+__PACKAGE__->config( namespace => '' );
+
+sub auto : Private {
+    my ( $self, $context ) = @_;
+    if ( $context->session ) {
+        return 1;
+    }
+
+}
+
+sub default : Private {
+    my ( $self, $context ) = @_;
+    my $html = html( "Root", "This is the root page" );
+    $context->response->content_type("text/html");
+    $context->response->output($html);
+}
+
+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 html {
+    my ( $title, $body ) = @_;
+    return qq{
+<html>
+<head><title>$title</title></head>
+<body>
+$body
+<a href="/hello/">Hello</a>.
+</body></html>
+};
+}
+
+1;
+