[Rt-commit] r5085 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Tue Apr 25 08:26:25 EDT 2006


Author: ruz
Date: Tue Apr 25 08:26:24 2006
New Revision: 5085

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/t/regression/26command_line.t

Log:
 r2163 at cubic-pc (orig r4740):  kevinr | 2006-03-14 00:52:02 +0300
  r11449 at SAD-GIRL-IN-SNOW:  kevinr | 2006-03-13 16:50:42 -0500
  * Added tests for listing and showing tickets from the command line
 


Modified: rt/branches/3.7-EXPERIMENTAL/lib/t/regression/26command_line.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/t/regression/26command_line.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/t/regression/26command_line.t	Tue Apr 25 08:26:24 2006
@@ -129,10 +129,33 @@
 # {{{ display
 
 # show ticket list
+expect_send("ls -s -t ticket -o +id \"Status='resolved'\"", 'Listing resolved tickets...');
+expect_like(qr/$ticket_id: new ticket/, 'Found our ticket');
 # show ticket list verbosely
+expect_send("ls -l -t ticket -o +id \"Status='resolved'\"", 'Listing resolved tickets verbosely...');
+expect_like(qr/id: ticket\/$ticket_id/, 'Found our ticket');
+# show ticket
+expect_send("show -t ticket $ticket_id", 'Showing our ticket...');
+expect_like(qr/id: ticket\/$ticket_id/, 'Got our ticket');
 # show ticket history
-# show ticket history verbosely
+expect_send("show ticket/$ticket_id/history", 'Showing our ticket\'s history...');
+expect_like(qr/Ticket created by root/, 'Got our history');
+TODO: {
+    todo_skip "Cannot show verbose ticket history right now", 2;
+    # show ticket history verbosely
+    expect_send("show -v ticket/$ticket_id/history", 'Showing our ticket\'s history verbosely...');
+    expect_like(qr/Ticket created by root/, 'Got our history');
+}
 # 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+)/;
+my $attachment_id = $1;
+my $attachment_type = $2;
+ok($attachment_id, "Got attachment id=$attachment_id $attachment_type");
+expect_send("show ticket/$ticket_id/attachments/$attachment_id", "Showing attachment $attachment_id...");
+expect_like(qr/ContentType: $attachment_type/, 'Got the attachment');
 
 # }}}
 


More information about the Rt-commit mailing list