[Jifty-commit] r1290 - in jifty: .

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 14 18:08:03 EDT 2006


Author: nelhage
Date: Wed Jun 14 18:07:58 2006
New Revision: 1290

Modified:
   jifty/   (props changed)
   jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm

Log:
 r12659 at phanatique:  nelhage | 2006-06-14 18:07:51 -0400
 Making J:T:WWW:Mech work with actions that have orderings


Modified: jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	(original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	Wed Jun 14 18:07:58 2006
@@ -10,6 +10,7 @@
 use HTTP::Cookies;
 use XML::XPath;
 use Hook::LexWrap;
+use List::Util qw(first);
 
 my $Test = Test::Builder->new;
 
@@ -49,7 +50,7 @@
   for my $f ($self->forms) {
   INPUT: 
     for my $input ($f->inputs) {
-      if ($input->type eq "hidden" and $input->name =~ /^J:A-(.*)/ and $input->value eq $action) {
+      if ($input->type eq "hidden" and $input->name =~ /^J:A-(?:\d+-)?(.*)/ and $input->value eq $action) {
 
         my $moniker = $1;
 
@@ -131,7 +132,9 @@
     my $i;
     for my $form ($self->forms) {
         $i++;
-        next unless $form->find_input("J:A-$moniker", "hidden");
+        next unless first {   $_->name =~ /J:A-(?:\d+-)?$moniker/
+                           && $_->type eq "hidden" }
+                        $form->inputs;
         next if grep {not $form->find_input("J:A:F-$_-$moniker")} @fields;
 
         $self->form_number($i); #select it, for $mech->submit etc


More information about the Jifty-commit mailing list