ad28c11650c966caedd7e73edc6af13a035e25fd
[catagits/Catalyst-View-Component-SubInclude.git] / t / 01esi.t
1 use strict;
2 use warnings;
3 use FindBin qw/$Bin/;
4 use lib "$Bin/lib";
5
6 use Test::More;
7 use Catalyst::Test 'ESITest';
8
9 like get('/'),
10 qr{SubInclude test: will include /time_include using default plugin Catalyst::View::Component::SubInclude::Visit<br/>
11 Current time is: [\w\s:]+ --> \| foo = bar \|\s*
12 <br/>
13 Current time is: [\w\s:]+ --> Capture Arg: test\| baz = quux \|\s*
14 <br/>
15
16 <br/><br/>
17 Test subinclude using specific plugins:<br/>
18 Current time is: [\w\s:]+ --> \| plugin = SubRequest \|\s*
19 <br/>
20 Current time is: [\w\s:]+ --> \| plugin = Visit \|\s*
21 <br/>
22 <!--esi <esi:include src="/time\?plugin=ESI" /> --><br/>
23 <!--#include virtual="/time\?plugin=SSI" --><br/>
24
25 <br/><br/>
26
27
28 Test CaptureArgs and Args interaction \(SubRequest\):<br/><br/>
29
30 Current time is: [\w\s:]+ --> Capture Arg: capture_argtest \| query_arg = val \|  Action Arg: regular_arg\s*
31 <br/>
32 \(using: http://localhost/capture_argtest/time/regular_arg\?query_arg=val\)<br/>
33 <br/>
34
35 Current time is: [\w\s:]+ -->  \| query_arg = val \|  Action Arg: regular_arg\s*
36 <br/>
37 \(using: http://localhost/time/regular_arg\?query_arg=val\)<br/>
38
39 <br/><br/>
40
41 Test CaptureArgs and Args interaction \(Visit\):<br/><br/>
42
43 Current time is: [\w\s:]+ --> Capture Arg: capture_argtest \| query_arg = val \|  Action Arg: regular_arg\s*
44 <br/>
45 \(using: http://localhost/capture_argtest/time/regular_arg\?query_arg=val\)<br/>
46 <br/>
47
48 Current time is: [\w\s:]+ -->  \| query_arg = val \|  Action Arg: regular_arg\s*
49 <br/>
50 \(using: http://localhost/time/regular_arg\?query_arg=val\)<br/>
51
52 <br/><br/>
53
54 Test CaptureArgs and Args interaction \(ESI\):<br/><br/>
55
56 <!--esi <esi:include src="/capture_argtest/time/regular_arg\?query_arg=val" /> --><br/>
57 \(using: http://localhost/capture_argtest/time/regular_arg\?query_arg=val\)<br/>
58 <br/>
59
60 <!--esi <esi:include src="/time/regular_arg\?query_arg=val" /> --><br/>
61 \(using: http://localhost/time/regular_arg\?query_arg=val\)<br/>
62
63 <br/><br/>
64
65 Test CaptureArgs and Args interaction \(SSI\):<br/><br/>
66
67 <!--#include virtual="/capture_argtest/time/regular_arg\?query_arg=val" --><br/>
68 \(using: http://localhost/capture_argtest/time/regular_arg\?query_arg=val\)<br/>
69 <br/>
70
71 <!--#include virtual="/time/regular_arg\?query_arg=val" --><br/>
72 \(using: http://localhost/time/regular_arg\?query_arg=val\)<br/>
73
74 <br/><br/><br/>
75
76 Test Args when Chained is not being used:
77 Current time is: [\w\s:]+ -->  \| query_arg = val \|  No Chained Args: regular_arg1, regular_arg2
78 <br/>
79 \(using: http://localhost/time_args_no_chained/regular_arg1/regular_arg2\?query_arg=val\)<br/>
80 };
81
82 done_testing;