[Rt-commit] rt branch, 3.999-trunk, updated. 6fe8c3c816b372c840666457a723cc1d124755e0

sartak at bestpractical.com sartak at bestpractical.com
Mon Nov 23 21:53:08 EST 2009


The branch, 3.999-trunk has been updated
       via  6fe8c3c816b372c840666457a723cc1d124755e0 (commit)
      from  4e7c2abf40fd20eb0e63452004c8824c4f1b8056 (commit)

Summary of changes:
 t/web/gnupg-outgoing.t |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 6fe8c3c816b372c840666457a723cc1d124755e0
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Nov 23 21:52:50 2009 -0500

    Jiftyfy t/web/gnupg-outgoing's form handling

diff --git a/t/web/gnupg-outgoing.t b/t/web/gnupg-outgoing.t
index 011a152..e9e0cb7 100644
--- a/t/web/gnupg-outgoing.t
+++ b/t/web/gnupg-outgoing.t
@@ -74,16 +74,16 @@ diag "check in read-only mode that queue's props influence create/update ticket
     foreach my $variant ( @variants ) {
         set_queue_crypt_options( %$variant );
         $m->goto_create_ticket( $queue );
-        $m->form_name('ticket_create');
+        my $form = $m->action_form('create_ticket');
         if ( $variant->{'encrypt'} ) {
-            ok $m->value('encrypt', 2), "encrypt tick box is checked";
+            ok $form->value('encrypt'), "encrypt tick box is checked";
         } else {
-            ok !$m->value('encrypt', 2), "encrypt tick box is unchecked";
+            ok !$form->value('encrypt'), "encrypt tick box is unchecked";
         }
         if ( $variant->{'sign'} ) {
-            ok $m->value('sign', 2), "sign tick box is checked";
+            ok $form->value('sign'), "sign tick box is checked";
         } else {
-            ok !$m->value('sign', 2), "sign tick box is unchecked";
+            ok !$form->value('sign'), "sign tick box is unchecked";
         }
     }
 
@@ -102,16 +102,16 @@ diag "check in read-only mode that queue's props influence create/update ticket
         set_queue_crypt_options( %$variant );
         $m->goto_ticket( $id );
         $m->follow_link_ok({text => 'Reply'}, '-> reply');
-        $m->form_number(3);
+        my $form = $m->action_form('create_ticket');
         if ( $variant->{'encrypt'} ) {
-            ok $m->value('encrypt', 2), "encrypt tick box is checked";
+            ok $form->value('encrypt'), "encrypt tick box is checked";
         } else {
-            ok !$m->value('encrypt', 2), "encrypt tick box is unchecked";
+            ok !$form->value('encrypt'), "encrypt tick box is unchecked";
         }
         if ( $variant->{'sign'} ) {
-            ok $m->value('sign', 2), "sign tick box is checked";
+            ok $form->value('sign'), "sign tick box is checked";
         } else {
-            ok !$m->value('sign', 2), "sign tick box is unchecked";
+            ok !$form->value('sign'), "sign tick box is unchecked";
         }
     }
 }
@@ -259,16 +259,18 @@ sub create_a_ticket {
     RT::Test->clean_caught_mails;
 
     $m->goto_create_ticket( $queue );
-    $m->form_name('ticket_create');
-    $m->field( subject    => 'test' );
-    $m->field( requestors => 'rt-test at example.com' );
-    $m->field( content    => 'Some content' );
+    $m->fill_in_action_ok('create_ticket' => (
+        subject    => 'test',
+        requestors => 'rt-test at example.com',
+        content    => 'Some content',
+    ));
+    my $form = $m->action_form('create_ticket');
 
     foreach ( qw(sign encrypt) ) {
         if ( $args{ $_ } ) {
-            $m->tick( $_ => 1 );
+            $form->tick( $_ => 1 );
         } else {
-            $m->untick( $_ => 1 );
+            $form->untick( $_ => 1 );
         }
     }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list