[Rt-commit] r4786 - in rt/branches/3.5-TESTING: . lib/t/regression

kevinr at bestpractical.com kevinr at bestpractical.com
Mon Mar 20 21:18:45 EST 2006


Author: kevinr
Date: Mon Mar 20 21:18:44 2006
New Revision: 4786

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/bin/rt.in
   rt/branches/3.5-TESTING/lib/t/regression/26command_line.t

Log:
 r11586 at sad-girl-in-snow:  kevinr | 2006-03-20 20:11:58 -0500
 * Fixed the problem where the RT CLI wouldn't let you create a new object if
 you weren't 'add'ing something to it (ie. if you were only 'set'ing values).
 Turns out that it wasn't grabbing a form from the server when creating a new
 object unless you 'add'ed something, so default values like queue weren't 
 getting filled in.


Modified: rt/branches/3.5-TESTING/bin/rt.in
==============================================================================
--- rt/branches/3.5-TESTING/bin/rt.in	(original)
+++ rt/branches/3.5-TESTING/bin/rt.in	Mon Mar 20 21:18:44 2006
@@ -447,13 +447,17 @@
     # We need a form to make changes to. We usually ask the server for
     # one, but we can avoid that if we are fed one on STDIN, or if the
     # user doesn't want to edit the form by hand, and the command line
-    # specifies only simple variable assignments.
+    # specifies only simple variable assignments.  We *should* get a
+    # form if we're creating a new ticket, so that the default values
+    # get filled in properly.
+
+    my @new_objects = grep /\/new$/, @objects;
 
     if ($input) {
         local $/ = undef;
         $text = <STDIN>;
     }
-    elsif ($edit || %add || %del || !$cl) {
+    elsif ($edit || %add || %del || !$cl || @new_objects) {
         my $r = submit("$REST/show", { id => \@objects, format => 'l' });
         $text = $r->content;
     }

Modified: rt/branches/3.5-TESTING/lib/t/regression/26command_line.t
==============================================================================
--- rt/branches/3.5-TESTING/lib/t/regression/26command_line.t	(original)
+++ rt/branches/3.5-TESTING/lib/t/regression/26command_line.t	Mon Mar 20 21:18:44 2006
@@ -58,12 +58,12 @@
 expect_handle->before() =~ /Ticket (\d+) created/;
 my $ticket_id = $1;
 ok($ticket_id, "Got ticket id=$ticket_id");
+expect_send(q{create -t ticket set subject='new ticket'}, "Creating a ticket as just a subject...");
+expect_like(qr/Ticket \d+ created/, "Created the ticket");
 
 # add a comment to ticket
 TODO: {
     local $TODO = "Adding comments/correspondence is broken right now";
-    expect_send(q{create -t ticket set subject='new ticket'}, "Creating a ticket as just a subject...");
-    expect_like(qr/Ticket \d+ created/, "Created the ticket");
     expect_send("comment -m 'comment-$$' $ticket_id", "Adding a comment...");
     expect_like(qr/Comment added/, "Added the comment");
     ### should test to make sure it actually got added


More information about the Rt-commit mailing list