[Rt-commit] rt branch, 4.0/preserve-time-units, updated. rt-4.0.1-216-gace0855

Jason May jasonmay at bestpractical.com
Wed Aug 3 17:57:09 EDT 2011


The branch, 4.0/preserve-time-units has been updated
       via  ace085550ba445431b698827d1eb09b984f14c47 (commit)
      from  dd4ef2eae02e97bda238fbda5c03e45e9eec42ac (commit)

Summary of changes:
 share/html/Admin/CustomFields/Objects.html |    2 +-
 share/html/Ticket/Create.html              |    2 +-
 t/web/ticket_modify_all.t                  |   25 ++++++++++++++++++++++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit ace085550ba445431b698827d1eb09b984f14c47
Author: Jason May <jasonmay at bestpractical.com>
Date:   Wed Aug 3 17:54:32 2011 -0400

    Cover time unit preservation among CF validation errors
    
    In this commit, some elements were provided names to get mech
    to play nicely with the HTML.

diff --git a/share/html/Admin/CustomFields/Objects.html b/share/html/Admin/CustomFields/Objects.html
index e1cc2ba..c71e4fb 100644
--- a/share/html/Admin/CustomFields/Objects.html
+++ b/share/html/Admin/CustomFields/Objects.html
@@ -50,7 +50,7 @@
 
 <& /Elements/ListActions, actions => \@results &>
 
-<form action="Objects.html" method="post">
+<form action="Objects.html" name="CustomFieldAppliesTo" method="post">
 <input type="hidden" class="hidden" name="id" value="<% $id %>" />
 
 % if ( $is_global ) {
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index b4de5c0..870eaee 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -189,7 +189,7 @@
         <& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $QueueObj &>
       </table>
     </&>
-    <& /Elements/Submit, Label => loc("Create"), id => 'SubmitTicket' &>
+    <& /Elements/Submit, Label => loc("Create"), Name => 'SubmitTicket', id => 'SubmitTicket' &>
   </div>
 </div>
 
diff --git a/t/web/ticket_modify_all.t b/t/web/ticket_modify_all.t
index 3e20e12..2bbcb4f 100644
--- a/t/web/ticket_modify_all.t
+++ b/t/web/ticket_modify_all.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 16;
+use RT::Test tests => 19;
 
 my $ticket = RT::Test->create_ticket(
     Subject => 'test bulk update',
@@ -42,3 +42,26 @@ $m->select("UpdateTimeWorked-TimeUnits" => 'hours');
 $m->click('AddMoreAttach');
 $m->form_name('TicketUpdate');
 is($m->value("UpdateTimeWorked-TimeUnits"), 'hours', 'time units stayed to "hours" after the form was submitted');
+
+my $cf = RT::Test->load_or_create_custom_field(
+    Name       => 'CF1',
+    Type       => 'Freeform',
+    Pattern    => '.', # mandatory
+    Queue      => 'General',
+);
+
+# More time unit testing by a failing CF validation
+$m->get_ok($url.'/Admin/CustomFields/Objects.html?id='.$cf->id);
+$m->form_name('CustomFieldAppliesTo');
+$m->tick('AddCustomField-'.$cf->id => '0'); # Make CF global
+$m->click('UpdateObjs');
+$m->text_contains('Object created', 'CF applied globally');
+
+$m->goto_create_ticket(1);
+
+$m->form_name('TicketCreate');
+$m->field('TimeWorked-TimeUnits' => 'hours');
+$m->click('SubmitTicket');
+
+$m->form_name('TicketCreate');
+is($m->value("TimeWorked-TimeUnits"), 'hours', 'time units stayed to "hours" after the form was submitted');

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


More information about the Rt-commit mailing list