[Rt-commit] r5097 - in rt/branches/3.7-EXPERIMENTAL: . bin
ruz at bestpractical.com
ruz at bestpractical.com
Tue Apr 25 08:48:42 EDT 2006
Author: ruz
Date: Tue Apr 25 08:48:30 2006
New Revision: 5097
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/bin/rt.in
rt/branches/3.7-EXPERIMENTAL/lib/t/regression/26command_line.t
Log:
r2193 at cubic-pc (orig r4786): kevinr | 2006-03-21 05:18:44 +0300
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.7-EXPERIMENTAL/bin/rt.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/rt.in (original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/rt.in Tue Apr 25 08:48:30 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.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:48:30 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