added test for ->view() with one view not returning a blessed instance
[catagits/Catalyst-Runtime.git] / t / lib / TestAppOneView / Controller / Root.pm
diff --git a/t/lib/TestAppOneView/Controller/Root.pm b/t/lib/TestAppOneView/Controller/Root.pm
new file mode 100644 (file)
index 0000000..1da451c
--- /dev/null
@@ -0,0 +1,24 @@
+package TestAppOneView::Controller::Root;
+
+use base 'Catalyst::Controller';
+use Scalar::Util ();
+
+__PACKAGE__->config->{namespace} = '';
+
+sub view_no_args : Local {
+    my ( $self, $c ) = @_;
+
+    my $v = $c->view;
+
+    $c->res->body(Scalar::Util::blessed($v));
+}
+
+sub view_by_name : Local {
+    my ( $self, $c ) = @_;
+
+    my $v = $c->view($c->req->param('view'));
+
+    $c->res->body(Scalar::Util::blessed($v));
+}
+
+1;