summaryrefslogtreecommitdiff
path: root/rt/t/api/ticket.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-07-02 21:11:29 -0700
committerIvan Kohler <ivan@freeside.biz>2013-07-02 21:11:29 -0700
commit3d0a1bb06b895c5be6e3f0517d355442a6b1e125 (patch)
tree84069ebc3254825b952a482e11cdbbbc69f6fe85 /rt/t/api/ticket.t
parentf3b99c11d6eed33f467dda360180a698a85c54e8 (diff)
parentd62206a94d9d49ef96640e0a8ec492679f8345e9 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/t/api/ticket.t')
-rw-r--r--rt/t/api/ticket.t31
1 files changed, 30 insertions, 1 deletions
diff --git a/rt/t/api/ticket.t b/rt/t/api/ticket.t
index 92c8a85df..da287a607 100644
--- a/rt/t/api/ticket.t
+++ b/rt/t/api/ticket.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
use RT;
-use RT::Test tests => 87;
+use RT::Test tests => undef;
{
@@ -254,3 +254,32 @@ ok(!$id,$msg);
}
+diag("Test ticket types with different cases");
+{
+ my $t = RT::Ticket->new(RT->SystemUser);
+ my ($ok) = $t->Create(
+ Queue => 'general',
+ Subject => 'type test',
+ Type => 'Ticket',
+ );
+ ok($ok, "Ticket allows passing upper-case Ticket as type during Create");
+ is($t->Type, "ticket", "Ticket type is lowercased during create");
+
+ ($ok) = $t->SetType("REMINDER");
+ ok($ok, "Ticket allows passing upper-case REMINDER to SetType");
+ is($t->Type, "reminder", "Ticket type is lowercased during set");
+
+ ($ok) = $t->SetType("OTHER");
+ ok($ok, "Allows setting Type to non-RT types");
+ is($t->Type, "OTHER", "Non-RT types are case-insensitive");
+
+ ($ok) = $t->Create(
+ Queue => 'general',
+ Subject => 'type test',
+ Type => 'Approval',
+ );
+ ok($ok, "Tickets can be created with an upper-case Approval type");
+ is($t->Type, "approval", "Approvals, the third and final internal type, are also lc'd during Create");
+}
+
+done_testing;