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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Nov 23 22:21:54 EST 2009


The branch, 3.999-trunk has been updated
       via  f2248c4a195b7faa1259d1c7bc5d1adfe8fa7a74 (commit)
      from  d85d8e776022674ce51f6a9e67d883c1d7e134c9 (commit)

Summary of changes:
 share/html/Admin/Global/GroupRights.html |    2 +-
 share/html/Admin/Queues/Modify.html      |    2 +-
 share/html/Search/Edit.html              |    2 +-
 share/html/Ticket/Modify.html            |    2 +-
 t/mail/gnupg-bad.t                       |    2 +-
 t/mail/gnupg-incoming.t                  |    2 +-
 t/mail/gnupg-realmail.t                  |    2 +-
 t/web/cf_access.t                        |    7 ++++---
 t/web/cf_onqueue.t                       |    5 +++--
 t/web/cf_select_one.t                    |   15 ++++++++-------
 t/web/gnupg-outgoing.t                   |    2 +-
 t/web/gnupg-select-keys-on-create.t      |   27 +++++++++++++--------------
 t/web/gnupg-select-keys-on-update.t      |   26 +++++++++++++-------------
 t/web/query_builder.t                    |    4 ++--
 t/web/rights.t                           |   10 +++++-----
 t/web/ticket_owner.t                     |    4 ++--
 16 files changed, 58 insertions(+), 56 deletions(-)

- Log -----------------------------------------------------------------
commit f2248c4a195b7faa1259d1c7bc5d1adfe8fa7a74
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 24 10:51:14 2009 +0800

    add form names, and update tests: form_number is not safe anymore

diff --git a/share/html/Admin/Global/GroupRights.html b/share/html/Admin/Global/GroupRights.html
index e72f4ba..4672c26 100755
--- a/share/html/Admin/Global/GroupRights.html
+++ b/share/html/Admin/Global/GroupRights.html
@@ -51,7 +51,7 @@
     title => _('Modify global group rights') &>  
 <& /Elements/ListActions, actions => \@results &>
 
-  <form method="post" action="GroupRights.html">
+  <form method="post" action="GroupRights.html" name="group_rights_modify">
       
 <&| /Widgets/TitleBox, title => _('Modify global group rights.')&>
       
diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index 2824db0..2f97389 100755
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -54,7 +54,7 @@
 
 
 
-<form action="<%RT->config->get('web_path')%>/Admin/Queues/Modify.html" method="post">
+<form action="<%RT->config->get('web_path')%>/Admin/Queues/Modify.html" method="post" name="queue_modify">
 <input type="hidden" class="hidden" name="set_enabled" value="1" />
 <input type="hidden" class="hidden" name="id" value="<% $create? 'new': $queue_obj->id %>" />
 
diff --git a/share/html/Search/Edit.html b/share/html/Search/Edit.html
index 9a50fe6..bded257 100755
--- a/share/html/Search/Edit.html
+++ b/share/html/Search/Edit.html
@@ -59,7 +59,7 @@
 
 <& Elements/NewListActions, actions => \@actions &>
 
-<form method="post" action="Build.html">
+<form method="post" action="Build.html" name="query_edit">
 <input type="hidden" class="hidden" name="saved_search_id" value="<% $saved_search_id %>" />
 <&|/Widgets/TitleBox, title => _('Query'), &>
 <textarea name="query" rows="8" cols="72"><% $query %></textarea>
diff --git a/share/html/Ticket/Modify.html b/share/html/Ticket/Modify.html
index 2f48630..577b492 100755
--- a/share/html/Ticket/Modify.html
+++ b/share/html/Ticket/Modify.html
@@ -53,7 +53,7 @@
 % $m->callback(callback_name => 'BeforeActionList', actions => \@results, args_ref => \%ARGS, ticket => $ticket_obj);
 
 <& /Elements/ListActions, actions => \@results &>
-<% Jifty->web->form->start( submit_to => '?id=' . $ticket_obj->id ) %>
+<% Jifty->web->form->start( name => 'ticket_modify', submit_to => '?id=' . $ticket_obj->id ) %>
 % $m->callback( callback_name => 'FormStart', args_ref => \%ARGS );
 <input type="hidden" class="hidden" name="id" value="<% $ticket_obj->id %>" />
 
diff --git a/t/mail/gnupg-bad.t b/t/mail/gnupg-bad.t
index b706a4f..1f2b537 100644
--- a/t/mail/gnupg-bad.t
+++ b/t/mail/gnupg-bad.t
@@ -42,7 +42,7 @@ $m->login;
 $m->content_like(qr/Logout/, 'we did log in');
 $m->get( $baseurl.'/Admin/Queues/');
 $m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_name => 'ticket_create',
          fields      => { correspond_address => 'rt at example.com' } );
 $m->content_like(qr/rt\@example.com.* - never/, 'has key info.');
 ok(my $user = RT::Model::User->new(current_user => RT->system_user));
diff --git a/t/mail/gnupg-incoming.t b/t/mail/gnupg-incoming.t
index d1fce46..23c00a7 100644
--- a/t/mail/gnupg-incoming.t
+++ b/t/mail/gnupg-incoming.t
@@ -48,7 +48,7 @@ $m->login();
 $m->content_like(qr/Logout/, 'we did log in');
 $m->get( $baseurl.'/Admin/Queues/');
 $m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_name => 'queue_modify',
 		 fields      => { correspond_address => 'general at example.com' } );
 $m->content_like(qr/general\@example.com.* - never/, 'has key info.');
 
diff --git a/t/mail/gnupg-realmail.t b/t/mail/gnupg-realmail.t
index bda9e00..7fe0ba4 100644
--- a/t/mail/gnupg-realmail.t
+++ b/t/mail/gnupg-realmail.t
@@ -45,7 +45,7 @@ my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login, 'we did log in';
 $m->get_ok( '/Admin/Queues/');
 $m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_name => 'queue_modify',
          fields      => { correspond_address => 'rt-recipient at example.com' } );
 $m->content_like(qr/rt-recipient\@example.com.* - never/, 'has key info.');
 
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index 217a52e..d6c9da4 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -18,7 +18,8 @@ diag "Create a CF" if $ENV{'TEST_VERBOSE'};
 {
     $m->follow_link( text => 'Configuration' );
     $m->title_is(q/RT Administration/, 'admin screen');
-    $m->follow_link( text => 'Custom Fields' );
+    $m->follow_link( text => 'Custom Fields', url_regex =>
+            qr!Admin/CustomFields! );
     $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
     $m->follow_link( text => 'Create' );
     $m->submit_form(
@@ -36,7 +37,7 @@ diag "apply the CF to General queue" if $ENV{'TEST_VERBOSE'};
 my ( $cf, $cfid, $tid );
 {
     $m->title_is(q/Created CustomField img/, 'admin-cf Created');
-    $m->follow_link( text => 'Queues' );
+    $m->follow_link( text => 'Queues', url_regex => qr!/Admin/Queues! );
     $m->title_is(q/Admin queues/, 'admin-queues screen');
     $m->follow_link( text => 'General' );
     $m->title_is(q/Editing Configuration for queue General/, 'admin-queue: general');
@@ -122,7 +123,7 @@ diag "check that we have no the CF on the create"
 
     $m->follow_link( text => 'Custom Fields' );
     $m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
-    $form = $m->form_number(3);
+    $form = $m->form_name('ticket_modify');
     ok !$form->find_input( "J:A:F-$cfid-$cf_moniker" ), 'no form field on the page';
 }
 
diff --git a/t/web/cf_onqueue.t b/t/web/cf_onqueue.t
index e12c759..986fdce 100644
--- a/t/web/cf_onqueue.t
+++ b/t/web/cf_onqueue.t
@@ -10,7 +10,8 @@ diag "Create a queue CF" if $ENV{'TEST_VERBOSE'};
 {
     $m->follow_link( text => 'Configuration' );
     $m->title_is(q/RT Administration/, 'admin screen');
-    $m->follow_link( text => 'Custom Fields' );
+    $m->follow_link( text => 'Custom Fields', url_regex =>
+            qr!Admin/CustomFields! );
     $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
     $m->follow_link( text => 'Create' );
     $m->submit_form(
@@ -51,7 +52,7 @@ diag "Edit the CF value for default queue" if $ENV{'TEST_VERBOSE'};
     $m->title_is(q/Editing Configuration for queue General/, 'default queue configuration screen');
     $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on default queue' );
     $m->submit_form(
-        form_number => 3,
+        form_name => 'queue_modify',
         # The following doesn't want to works :(
         #with_fields => { 'object-RT::Model::Queue-1-CustomField-1-value' },
         fields => {
diff --git a/t/web/cf_select_one.t b/t/web/cf_select_one.t
index d642593..f79a7aa 100644
--- a/t/web/cf_select_one.t
+++ b/t/web/cf_select_one.t
@@ -17,7 +17,8 @@ diag "Create a CF" if $ENV{'TEST_VERBOSE'};
 {
     $m->follow_link( text => 'Configuration' );
     $m->title_is(q/RT Administration/, 'admin screen');
-    $m->follow_link( text => 'Custom Fields' );
+    $m->follow_link( text => 'Custom Fields', url_regex =>
+            qr!Admin/CustomFields! );
     $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
     $m->follow_link( text => 'Create' );
     $m->submit_form(
@@ -95,12 +96,12 @@ diag "check that values of the CF are case insensetive(asd vs. ASD)"
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
     $m->content_like(qr/\Q$cf_name/, 'CF on the page');
 
-    my $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    my $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is lc $value, 'asd', 'correct value is selected';
     $m->submit;
     $m->content_unlike(qr/\Q$cf_name\E.*?changed/mi, 'field is not changed');
 
-    $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is lc $value, 'asd', 'the same value is still selected';
     my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
     $ticket->load( $tid );
@@ -117,14 +118,14 @@ diag "check that 0 is ok value of the CF"
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
     $m->content_like(qr/\Q$cf_name/, 'CF on the page');
 
-    my $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    my $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is lc $value, 'asd', 'correct value is selected';
     $m->select("J:A:F-$cfid-$cf_moniker" => 0 );
     $m->submit;
     $m->content_like(qr/\Q$cf_name\E.*?changed/mi, 'field is changed');
     $m->content_unlike(qr/0 is no longer a value for custom field/mi, 'no bad message in results');
 
-    $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is lc $value, '0', 'new value is selected';
 
     my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
@@ -142,13 +143,13 @@ diag "check that we can set empty value when the current is 0"
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
     $m->content_like(qr/\Q$cf_name/, 'CF on the page');
 
-    my $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    my $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is lc $value, '0', 'correct value is selected';
     $m->select("J:A:F-$cfid-$cf_moniker" => '' );
     $m->submit;
     $m->content_like(qr/0 is no longer a value for custom field/mi, '0 is no longer a value');
 
-    $value = $m->form_number(3)->value("J:A:F-$cfid-$cf_moniker");
+    $value = $m->form_name('ticket_modify')->value("J:A:F-$cfid-$cf_moniker");
     is $value, '', '(no value) is selected';
 
     my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
diff --git a/t/web/gnupg-outgoing.t b/t/web/gnupg-outgoing.t
index e9e0cb7..e5d1c66 100644
--- a/t/web/gnupg-outgoing.t
+++ b/t/web/gnupg-outgoing.t
@@ -293,7 +293,7 @@ sub update_ticket {
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->field( update_content => 'Some content' );
 
     foreach ( qw(sign encrypt) ) {
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index d14094c..57af1b6 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -57,7 +57,7 @@ diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( sign => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -71,7 +71,6 @@ diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
 }
-
 {
     RT::Test->import_gnupg_key('rt-recipient at example.com');
     RT::Test->trust_gnupg_key('rt-recipient at example.com');
@@ -84,7 +83,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -98,7 +97,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok !$form->find_input( 'UseKey-rt-test at example.com' ), 'no key selector';
 
     my @mail = RT::Test->fetch_caught_mails;
@@ -119,7 +118,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -133,7 +132,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 1, 'one option';
 
@@ -166,7 +165,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -180,7 +179,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -212,7 +211,7 @@ diag "check that we see key selector even if only one key is trusted but there a
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -226,7 +225,7 @@ diag "check that we see key selector even if only one key is trusted but there a
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -240,7 +239,7 @@ diag "check that key selector works and we can select trusted key"
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -254,7 +253,7 @@ diag "check that key selector works and we can select trusted key"
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -272,7 +271,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
     RT::Test->clean_caught_mails;
 
     ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
-    $m->form_number(3);
+    $m->form_name('ticket_create');
     $m->tick( encrypt => 1 );
     $m->field( requestors => 'rt-test at example.com' );
     $m->field( content => 'Some content' );
@@ -287,7 +286,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_create');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index df115cd..e28f766 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -69,7 +69,7 @@ diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( sign => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -97,7 +97,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -111,7 +111,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok !$form->find_input( 'UseKey-rt-test at example.com' ), 'no key selector';
 
     my @mail = RT::Test->fetch_caught_mails;
@@ -134,7 +134,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -148,7 +148,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 1, 'one option';
 
@@ -182,7 +182,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -196,7 +196,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -228,7 +228,7 @@ diag "check that we see key selector even if only one key is trusted but there a
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -242,7 +242,7 @@ diag "check that we see key selector even if only one key is trusted but there a
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -256,7 +256,7 @@ diag "check that key selector works and we can select trusted key" if $ENV{TEST_
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -270,7 +270,7 @@ diag "check that key selector works and we can select trusted key" if $ENV{TEST_
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
@@ -289,7 +289,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
 
     ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
     $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
-    $m->form_number(3);
+    $m->form_name('ticket_update');
     $m->tick( encrypt => 1 );
     $m->field( update_cc => 'rt-test at example.com' );
     $m->field( update_content => 'Some content' );
@@ -304,7 +304,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
         'problems with keys'
     );
 
-    my $form = $m->form_number(3);
+    my $form = $m->form_name('ticket_update');
     ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
     is scalar $input->possible_values, 2, 'two options';
 
diff --git a/t/web/query_builder.t b/t/web/query_builder.t
index 38ff64d..24f46de 100644
--- a/t/web/query_builder.t
+++ b/t/web/query_builder.t
@@ -146,7 +146,7 @@ diag "click advanced, enter 'C1 OR ( C2 AND C3 )', apply, aggregators should sta
 {
     my $response = $agent->get($url."/Search/Edit.html");
     ok( $response->is_success, "Fetched /Search/Edit.html" );
-    ok($agent->form_number(3), "found the form");
+    ok($agent->form_name('query_edit'), "found the form");
     $agent->field("query", "Status = 'new' OR ( Status = 'open' AND subject LIKE 'office' )");
     $agent->submit;
     is( get_query_from_form,
@@ -234,7 +234,7 @@ diag "input a condition, select (several conditions), click delete"
 {
     my $response = $agent->get( $url."/Search/Edit.html" );
     ok $response->is_success, "Fetched /Search/Edit.html";
-    ok $agent->form_number(3), "found the form";
+    ok $agent->form_name('query_edit'), "found the form";
     $agent->field("query", "( Status = 'new' OR Status = 'open' )");
     $agent->submit;
     is( get_query_from_form,
diff --git a/t/web/rights.t b/t/web/rights.t
index 2645c08..cf6a256 100644
--- a/t/web/rights.t
+++ b/t/web/rights.t
@@ -16,7 +16,7 @@ sub get_rights {
     my $agent = shift;
     my $principal_id = shift;
     my $object = shift;
-    $agent->form_number(3);
+    $agent->form_name('group_rights_modify');
     my @inputs = $agent->current_form->find_input("revoke_right-$principal_id-$object");
     my @Rights = sort grep $_, map $_->possible_values, grep $_, @inputs;
     return @Rights;
@@ -33,7 +33,7 @@ my ($everyone, $everyone_gid);
 diag "revoke all global rights from Everyone group" if $ENV{'TEST_VERBOSE'};
 my @has = get_rights( $m, $everyone_gid, 'RT::System-1' );
 if ( @has ) {
-    $m->form_number(3);
+    $m->form_name('group_rights_modify');
     $m->tick("revoke_right-$everyone_gid-RT::System-1", $_) foreach @has;
     $m->submit;
     
@@ -44,7 +44,7 @@ if ( @has ) {
 
 diag "grant SuperUser right to everyone" if $ENV{'TEST_VERBOSE'};
 {
-    $m->form_number(3);
+    $m->form_name('group_rights_modify');
     $m->select("grant_right-$everyone_gid-RT::System-1", ['SuperUser']);
     $m->submit;
 
@@ -56,7 +56,7 @@ diag "grant SuperUser right to everyone" if $ENV{'TEST_VERBOSE'};
 
 diag "revoke the right" if $ENV{'TEST_VERBOSE'};
 {
-    $m->form_number(3);
+    $m->form_name('group_rights_modify');
     $m->tick("revoke_right-$everyone_gid-RT::System-1", 'SuperUser');
     $m->submit;
 
@@ -69,7 +69,7 @@ diag "revoke the right" if $ENV{'TEST_VERBOSE'};
 
 diag "return rights the group had in the beginning" if $ENV{'TEST_VERBOSE'};
 if ( @has ) {
-    $m->form_number(3);
+    $m->form_name('group_rights_modify');
     $m->select("grant_right-$everyone_gid-RT::System-1", \@has);
     $m->submit;
 
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index eeceb3b..2a23ed0 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -102,7 +102,7 @@ diag "user A can not change owner after create" if $ENV{TEST_VERBOSE};
         $agent->goto_ticket( $id );
         diag("Going to ticket $id") if $ENV{TEST_VERBOSE};
         $agent->follow_link_ok(text => 'Basics');
-        my $form = $agent->form_number(3);
+        my $form = $agent->form_name('ticket_modify');
         is $agent->action_field_value(
             $agent->moniker_for('RT::Action::UpdateTicket'), 'owner'
           ),
@@ -142,7 +142,7 @@ diag "on reply correct owner is selected" if $ENV{TEST_VERBOSE};
     $agent_a->goto_ticket( $id );
     $agent_a->follow_link_ok(text => 'Reply');
 
-    my $form = $agent_a->form_number(3);
+    my $form = $agent_a->form_name('ticket_update');
     is $form->value('owner'), '', 'empty value selected';
     $agent_a->submit;
 

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


More information about the Rt-commit mailing list