Commit | Line | Data |
---|---|---|
42d0a52a | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More; | |
98d049ef | 4 | |
53c7cc10 | 5 | BEGIN { |
98d049ef | 6 | package MyApp::Model::AcceptContext; |
7 | use base 'Catalyst::Model'; | |
8 | ||
9 | sub ACCEPT_CONTEXT { | |
10 | my ($self, $c, @args) = @_; | |
42d0a52a | 11 | Test::More::ok( ref $c); |
98d049ef | 12 | } |
13 | ||
14 | $INC{'MyApp/Model/AcceptContext.pm'} = __FILE__; | |
53c7cc10 | 15 | } |
98d049ef | 16 | |
53c7cc10 | 17 | BEGIN { |
98d049ef | 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__; | |
53c7cc10 | 27 | } |
98d049ef | 28 | |
53c7cc10 | 29 | BEGIN { |
98d049ef | 30 | package MyApp; |
31 | use Catalyst; | |
88e5a8b0 | 32 | |
98d049ef | 33 | MyApp->setup; |
34 | } | |
35 | ||
36 | use Catalyst::Test 'MyApp'; | |
37 | ||
53c7cc10 | 38 | my ($res, $c) = ctx_request('/root/test_model'); |
98d049ef | 39 | |
40 | ok $res; | |
41 | ||
98d049ef | 42 | done_testing; |