[Jifty-commit] r3030 - in jifty/trunk: lib/Jifty/Test/WWW

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Mar 19 17:07:37 EDT 2007


Author: sterling
Date: Mon Mar 19 17:07:37 2007
New Revision: 3030

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

Log:
 r4119 at riddle:  andrew | 2007-03-19 16:06:22 -0500
 Modified submit_html_ok to make it behave like the documentation says it should.


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	Mon Mar 19 17:07:37 2007
@@ -387,14 +387,29 @@
 
 =head2 submit_html_ok 
 
-Calls C<submit>, followed by testing the HTML using
+With no arguments, this method calls L<WWW::Mechanize/submit>. 
+
+  $mech->submit_html_ok();
+
+With arguments, it calls L<WWW::Mechanize/click_button> and passes all arguments to it.
+
+  $mech->submit_html_ok( value => 'Save' );
+
+In both cases, this call is followed by testing the HTML using
 L<Test::HTML::Lint>.
 
 =cut
 
 sub submit_html_ok {
     my $self = shift;
-    $self->submit(@_);
+
+    if (@_) {
+        $self->click_button(@_);
+    }
+    else {
+        $self->submit;
+    }
+
     {
         local $Test::Builder::Level = $Test::Builder::Level;
         $Test::Builder::Level++;


More information about the Jifty-commit mailing list