X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_basic.t;h=b6e112aac39c35697a871ec9a0fcb4144922dcc8;hb=9c11a56203c2d14482446edf9d00b4001bef7877;hp=a54e2cadc418283416b25df838d12d5c64c3b729;hpb=a0ebba1daf689ec5c409497bd1b11cc903c080b2;p=catagits%2FCatalystX-Declare.git diff --git a/t/001_basic.t b/t/001_basic.t index a54e2ca..b6e112a 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -5,7 +5,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 7; +use Test::More tests => 17; use Catalyst::Test 'TestApp'; # simple stuff @@ -22,3 +22,31 @@ is get('/foo/under/23'), 'under 23', 'under as keyword'; # comma separation is get('/foo/,comma/iaia'), 'iaia', 'comma separation'; + +# nested under +is get('/foo/lower/down/the/stream'), 'foo/stream', 'nested under blocks'; + +# action roles +do { + local $ENV{TESTAPP_ACTIONROLE} = 1; + is get('/foo/with_role'), 'YES', 'fully named action role works'; +}; +do { + local $ENV{TESTAPP_ACTIONROLE} = 0; + is get('/foo/with_role'), 'NO', 'aliased action role works'; +}; + +# action class +is get('/foo/book/Whatever/view/xml'), 'Page 1 of "Whatever" as XML', 'action class was set'; +is get('/foo/book/Fnord/view/html?page=7'), 'Page 7 of "Fnord" as HTML', 'action class was set'; + +# final keyword +is get('/foo/finals/in_front'), 'foo/in_front', 'final syntax element as declarator'; +is get('/foo/finals/final_middle'), 'foo/final_middle', 'final syntax element in the middle'; +is get('/foo/finals/final_at_end'), 'foo/final_at_end', 'final syntax element at the end'; + +# privates +is get('/foo/expose_not_really_here'), 23, 'private action works'; + +# specify chain target directly via action +is get('/foo/pointed/beaver'), 'Your beaver is pointed!', 'chain target specified via action';