Fix generate_rs to set model to contents of stash->{class} if present and add tests.
[catagits/Catalyst-Controller-DBIC-API.git] / t / lib / RestTest / Controller / API / REST / StashedClass.pm
diff --git a/t/lib/RestTest/Controller/API/REST/StashedClass.pm b/t/lib/RestTest/Controller/API/REST/StashedClass.pm
new file mode 100644 (file)
index 0000000..804e7ae
--- /dev/null
@@ -0,0 +1,13 @@
+package RestTest::Controller::API::REST::StashedClass;
+use Moose;
+BEGIN { extends 'Catalyst::Controller::DBIC::API::REST' }
+
+use namespace::autoclean;
+
+sub setup :Chained('/api/rest/rest_base') :CaptureArgs(1) :PathPart('stashedclass') {
+    my ($self, $c, $class) = @_;
+    $c->stash->{class} = $class;
+    $self->next::method($c);
+}
+
+1;