[Catalyst-commits] r12878 - in Catalyst-Plugin-FormValidator/trunk:
lib/Catalyst/Plugin t t/lib/TestApp/Controller
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Mon Feb 15 21:45:40 GMT 2010
Author: dhoss
Date: 2010-02-15 21:45:39 +0000 (Mon, 15 Feb 2010)
New Revision: 12878
Modified:
Catalyst-Plugin-FormValidator/trunk/lib/Catalyst/Plugin/FormValidator.pm
Catalyst-Plugin-FormValidator/trunk/t/04basic.t
Catalyst-Plugin-FormValidator/trunk/t/lib/TestApp/Controller/Root.pm
Log:
made form attr rw, and using HTTP::Request::Common instead of TWMCatalyst
Modified: Catalyst-Plugin-FormValidator/trunk/lib/Catalyst/Plugin/FormValidator.pm
===================================================================
--- Catalyst-Plugin-FormValidator/trunk/lib/Catalyst/Plugin/FormValidator.pm 2010-02-15 21:36:52 UTC (rev 12877)
+++ Catalyst-Plugin-FormValidator/trunk/lib/Catalyst/Plugin/FormValidator.pm 2010-02-15 21:45:39 UTC (rev 12878)
@@ -7,7 +7,7 @@
$VERSION = eval $VERSION;
has 'form' => (
- is => 'ro',
+ is => 'rw',
required => 1,
lazy_build => 1,
);
Modified: Catalyst-Plugin-FormValidator/trunk/t/04basic.t
===================================================================
--- Catalyst-Plugin-FormValidator/trunk/t/04basic.t 2010-02-15 21:36:52 UTC (rev 12877)
+++ Catalyst-Plugin-FormValidator/trunk/t/04basic.t 2010-02-15 21:45:39 UTC (rev 12878)
@@ -3,10 +3,9 @@
use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::WWW::Mechanize::Catalyst;
- my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'TestApp');
use_ok('Catalyst::Test', 'TestApp');
-$mech->get_ok("/form_test");
+ok(request("/form_test")->is_success, "got initial url");
+
done_testing;
\ No newline at end of file
Modified: Catalyst-Plugin-FormValidator/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-FormValidator/trunk/t/lib/TestApp/Controller/Root.pm 2010-02-15 21:36:52 UTC (rev 12877)
+++ Catalyst-Plugin-FormValidator/trunk/t/lib/TestApp/Controller/Root.pm 2010-02-15 21:45:39 UTC (rev 12878)
@@ -14,6 +14,11 @@
<input type="submit" name="press" />
</form>
});
+ $c->form(required => ['testinput']);
+ if ($c->req->param('testinput')) {
+ my $result = $c->form->valid('testinput');
+ $c->res->body($result);
+ }
}
__PACKAGE__->meta->make_immutable;
\ No newline at end of file
More information about the Catalyst-commits
mailing list