--- trunk/t/01-frey-action.t 2008/11/24 21:49:38 502 +++ branches/zimbardo/t/01-Frey-Action.t 2009/07/05 21:40:16 1172 @@ -4,7 +4,7 @@ my $debug = @ARGV ? 1 : 0; -use Test::More tests => 26; +use Test::More tests => 28; use lib 'lib'; use Data::Dump qw/dump/; @@ -19,6 +19,10 @@ diag ref( $required ) if $debug; isa_ok( $required, 'ARRAY', 'required' ); +ok( $required = $o->required( as_hash => 1 ), 'required as_hash' ); +diag dump $required; +isa_ok( $required, 'HASH', 'hash' ); + ok( my $attributes = $o->attributes, 'attributes' ); diag dump( $attributes ) if $debug; is_deeply( $attributes, ["uri", "feed", "title"], 'attributes' ); @@ -44,7 +48,7 @@ cmp_ok( $html, 'eq', $html2, 'html same' ); ok( $default->{uri}, 'uri has default' ); -ok( $o = Frey::Action->new( class => 'Frey::ClassBrowser', debug => $debug, params => { unneeded => 1 } ), "new Frey::ClassBrowser" ); +ok( $o = Frey::Action->new( class => 'Frey::Class::Browser', debug => $debug, params => { unneeded => 1 } ), "new Frey::Class::Browser" ); ok( ($html2,$default) = $o->params_form, 'params_form' ); ok( ! $html2, 'no form' ); ok( $default->{unneeded}, 'preserve params' ); @@ -54,7 +58,7 @@ diag $html if $debug; like( $html, qr/class/, 'required form field class' ); -ok( $o = Frey::Action->new( class => 'Frey::Introspect', params => { class => 'Frey' }, debug => $debug ), "new Frey::Introspect" ); +ok( $o = Frey::Action->new( class => 'Frey::Introspect', params => { request_url => '/', class => 'Frey' }, debug => $debug ), "new Frey::Introspect" ); ok( ! $o->params_form, 'params_form empty' ); - +diag $o->params_form if $o->params_form;