[Rt-commit] r7828 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: html/REST/1.0/Forms/ticket t/web

clsung at bestpractical.com clsung at bestpractical.com
Fri May 11 05:42:48 EDT 2007


Author: clsung
Date: Fri May 11 05:42:46 2007
New Revision: 7828

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/REST/1.0/Forms/ticket/attachments
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/command_line.t

Log:
 r1045 at going04:  clsung | 2007-05-11 17:42:22 +0800
 - Filename can be empty, so we set '(Unnamed)' for it
 - modify the corresponding test case


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/REST/1.0/Forms/ticket/attachments
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/REST/1.0/Forms/ticket/attachments	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/REST/1.0/Forms/ticket/attachments	Fri May 11 05:42:46 2007
@@ -118,7 +118,7 @@
             my $size = length($a->Content);
             if ($size > 1024) { $size  = int($size/102.4)/10 . "k" }
             else              { $size .= "b" }
-            push @attachments, $a->Id.": ".$a->Filename." (".$a->ContentType . " / ".$size.")";
+            push @attachments, $a->Id.": ".($a->Filename || '(Unnamed)')." (".$a->ContentType . " / ".$size.")";
         }
     }
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/command_line.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/command_line.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/command_line.t	Fri May 11 05:42:46 2007
@@ -177,8 +177,8 @@
 # get attachments from a ticket
 expect_send("show ticket/$ticket_id/attachments", 'Showing ticket attachments...');
 expect_like(qr/id: ticket\/$ticket_id\/attachments/, 'Got our ticket\'s attachments');
-expect_like(qr/Attachments: \d+:\s*\(\S+ \/ \d+\w+\)/, 'Our ticket has an attachment');
-expect_handle->before() =~ /Attachments: (\d+):\s*\((\S+)/;
+expect_like(qr/Attachments: \d+: \(Unnamed\) \(\S+ \/ \d+\w+\)/, 'Our ticket has an attachment');
+expect_handle->before() =~ /Attachments: (\d+): \(Unnamed\) \((\S+)/;
 my $attachment_id = $1;
 my $attachment_type = $2;
 ok($attachment_id, "Got attachment id=$attachment_id $attachment_type");


More information about the Rt-commit mailing list