Adding Test::WWW::Selenium::Catalyst
[catagits/Test-WWW-Selenium-Catalyst.git] / t / lib / TestApp / Controller / Root.pm
diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm
new file mode 100755 (executable)
index 0000000..1e6ed15
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/perl\r
+# Root.pm \r
+# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>\r
+\r
+package TestApp::Controller::Root;\r
+use base qw(Catalyst::Controller);\r
+__PACKAGE__->config->{namespace} = q{};\r
+my @words = qw(foo bar baz bat qux quux);\r
+\r
+sub index : Private {\r
+    my ($self, $c, @args) = @_;\r
+    my $words = $c->uri_for('/words');\r
+    $c->response->body(<<"HERE");\r
+<html>\r
+<head>\r
+<title>TestApp</title>\r
+</head>\r
+<body>\r
+<h1>TestApp</h1>\r
+<p>This is the TestApp.</p>\r
+<p><a href="$words">Click here</a> to <i>see</i> some words.</p>\r
+</body>\r
+</html>    \r
+HERE\r
+}\r
+\r
+sub words : Local {\r
+    my ($self, $c, $times) = @_;\r
+    $times ||= 0;\r
+    my $html = <<"HEADER";\r
+<html>\r
+<head>\r
+<title>TestApp</title>\r
+</head>\r
+<body>\r
+<h1>TestApp &lt;&lt; Words</h1>\r
+<p>Here you'll find all things "words" printed $times time(s)!</p>\r
+<ul>\r
+HEADER\r
+    local $" = q{ }; # single space\r
+    $html .= " <li>$_: @words</li>\n" for 1..$times;\r
+    $html .= <<"FOOTER"; \r
+</ul>\r
+</body>\r
+</html>\r
+FOOTER\r
+    $c->response->body($html);\r
+}\r
+\r
+sub null : Path('/favicon.ico'){\r
+    my ($self, $c) = @_;\r
+    $c->response->status(404); # doesn't exist\r
+}\r
+\r
+1; # true.\r
+\r