update distar url
[catagits/Catalyst-Runtime.git] / t / accept_context_regression.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 BEGIN {
6   package MyApp::Model::AcceptContext;
7   use base 'Catalyst::Model';
8
9   sub ACCEPT_CONTEXT {
10     my ($self, $c, @args) = @_;
11     Test::More::ok( ref $c);
12   }
13
14   $INC{'MyApp/Model/AcceptContext.pm'} = __FILE__;
15 }
16
17 BEGIN {
18   package MyApp::Controller::Root;
19   use base 'Catalyst::Controller';
20
21   sub test_model :Local {
22     my ($self, $c) = @_;
23     $c->res->body('test');
24   }
25
26   $INC{'MyApp/Controller/Root.pm'} = __FILE__;
27 }
28
29 BEGIN {
30   package MyApp;
31   use Catalyst;
32
33   MyApp->setup;
34 }
35
36 use Catalyst::Test 'MyApp';
37
38 my ($res, $c) = ctx_request('/root/test_model');
39
40 ok $res;
41
42 done_testing;