Commit | Line | Data |
98d049ef |
1 | use Test::Most; |
2 | |
3 | { |
4 | package MyApp::Model::AcceptContext; |
5 | use base 'Catalyst::Model'; |
6 | |
7 | sub ACCEPT_CONTEXT { |
8 | my ($self, $c, @args) = @_; |
9 | Test::Most::ok( ref $c); |
10 | } |
11 | |
12 | $INC{'MyApp/Model/AcceptContext.pm'} = __FILE__; |
13 | |
14 | package MyApp::Controller::Root; |
15 | use base 'Catalyst::Controller'; |
16 | |
17 | sub test_model :Local { |
18 | my ($self, $c) = @_; |
19 | $c->res->body('test'); |
20 | } |
21 | |
22 | $INC{'MyApp/Controller/Root.pm'} = __FILE__; |
23 | |
24 | package MyApp; |
25 | use Catalyst; |
26 | |
27 | MyApp->setup; |
28 | } |
29 | |
30 | use Catalyst::Test 'MyApp'; |
31 | |
32 | my ($res, $c) = ctx_request('/test_model'); |
33 | |
34 | ok $res; |
35 | |
36 | use Devel::Dwarn; |
37 | #Dwarn $c->model('AcceptContext'); |
38 | |
39 | done_testing; |
40 | |