Skip to content
Browse files

add test for bad form numbers

  • Loading branch information...
1 parent de8cbed commit f43debb507f2f897cb3a56c9df56d7b83a8ea13f @petdance committed Apr 16, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 t/submit_form_ok.t
View
15 t/submit_form_ok.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
use Test::Builder::Tester;
use Test::WWW::Mechanize ();
@@ -22,6 +22,19 @@ SUBMIT_GOOD_FORM: {
$mech->submit_form_ok( {form_number =>1}, 'Submit First Form' );
}
+SUBMIT_BAD_FORM: {
+ my $mech = Test::WWW::Mechanize->new();
+ isa_ok( $mech,'Test::WWW::Mechanize' );
+
+ $mech->get_ok( "$server_root/form.html" );
+
+ test_out( 'not ok 2 - Submit 14th form' );
+ test_fail( +2 );
+ my $ok = $mech->submit_form_ok( {form_number => 14}, 'Submit 14th (and thus non-existent) form' );
+ test_test( 'Get the correct line reference back' );
+ is( !$ok, 'And the results should be false' );
+}
+
$server->stop;
done_testing();

0 comments on commit f43debb

Please sign in to comment.
Something went wrong with that request. Please try again.