[Rt-commit] r9081 - rt/branches/3.6-RELEASE/lib/t/regression
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Sep 18 01:13:10 EDT 2007
Author: sunnavy
Date: Tue Sep 18 01:13:09 2007
New Revision: 9081
Modified:
rt/branches/3.6-RELEASE/lib/t/regression/26command_line.t
Log:
added tests for set/add/del values for custom field with multiple
values in command line
Modified: rt/branches/3.6-RELEASE/lib/t/regression/26command_line.t
==============================================================================
--- rt/branches/3.6-RELEASE/lib/t/regression/26command_line.t (original)
+++ rt/branches/3.6-RELEASE/lib/t/regression/26command_line.t Tue Sep 18 01:13:09 2007
@@ -3,7 +3,7 @@
use strict;
use Test::Expect;
#use Test::More qw/no_plan/;
-use Test::More tests => 216;
+use Test::More tests => 235;
use RT;
RT::LoadConfig();
@@ -100,6 +100,10 @@
($val,$msg) = $othercf->Create(Name => 'My CF'.$$, Type => 'FreeformSingle', Queue => $queue_id);
ok($val,$msg);
+my $multiple_cf = RT::CustomField->new($RT::SystemUser);
+($val,$msg) = $multiple_cf->Create(Name => 'MultipleCF'.$$, Type =>
+ 'FreeformMultiple', Queue => $queue_id);
+ok($val,$msg);
# add a comment to ticket
@@ -163,6 +167,26 @@
expect_send("show ticket/$ticket_id -f 'CF-my CF$$'", 'Checking new value');
expect_like(qr/my CF$$: VALUE/i, 'Verified change');
+# Test reading and setting custom fields with multiple values
+expect_send("show ticket/$ticket_id -f CF-MultipleCF$$", 'Checking initial value');
+expect_like(qr/CF-MultipleCF$$:/i, 'Verified multiple cf change');
+expect_send("edit ticket/$ticket_id set CF-MultipleCF$$=1,2,3 ", 'Changing CF...');
+expect_like(qr/Ticket $ticket_id updated/, 'Changed multiple cf');
+expect_send("show ticket/$ticket_id -f CF-MultipleCF$$", 'Checking new value');
+expect_like(qr/CF-MultipleCF$$: 1,2,3/i, 'Verified multiple cf change');
+expect_send("edit ticket/$ticket_id set CF-MultipleCF$$=a,b,c ", 'Changing CF...');
+expect_like(qr/Ticket $ticket_id updated/, 'Changed multiple cf');
+expect_send("show ticket/$ticket_id -f CF-MultipleCF$$", 'Checking new value');
+expect_like(qr/CF-MultipleCF$$: a,b,c/i, 'Verified change');
+expect_send("edit ticket/$ticket_id del CF-MultipleCF$$=a ", 'Changing CF...');
+expect_like(qr/Ticket $ticket_id updated/, 'del multiple cf');
+expect_send("show ticket/$ticket_id -f CF-MultipleCF$$", 'Checking new value');
+expect_like(qr/CF-MultipleCF$$: b,\s*c/i, 'Verified multiple cf change');
+expect_send("edit ticket/$ticket_id add CF-MultipleCF$$=o ", 'Changing CF...');
+expect_like(qr/Ticket $ticket_id updated/, 'Changed multiple cf');
+expect_send("show ticket/$ticket_id -f CF-MultipleCF$$", 'Checking new value');
+expect_like(qr/CF-MultipleCF$$: b,\s*c,\s*o/i, 'Verified multiple cf change');
+
# ...
# change a ticket's ...[other properties]...
# ...
@@ -440,4 +464,6 @@
expect_is($attachment_content,"Attachment contains original text");
}
+
+
1;
More information about the Rt-commit
mailing list