[Rt-commit] r3090 - in RT-Action-ExtractSubjectTag: . t
kevinr at bestpractical.com
kevinr at bestpractical.com
Wed Jun 8 18:00:03 EDT 2005
Author: kevinr
Date: Wed Jun 8 18:00:03 2005
New Revision: 3090
Modified:
RT-Action-ExtractSubjectTag/ (props changed)
RT-Action-ExtractSubjectTag/t/01extract_tags.t
Log:
r4065 at sad-girl-in-snow: kevinr | 2005-06-08 13:40:02 -0400
* added test to ensure the same tag is not added multiple times
Modified: RT-Action-ExtractSubjectTag/t/01extract_tags.t
==============================================================================
--- RT-Action-ExtractSubjectTag/t/01extract_tags.t (original)
+++ RT-Action-ExtractSubjectTag/t/01extract_tags.t Wed Jun 8 18:00:03 2005
@@ -85,9 +85,19 @@
# add the tag on correspond
($id, $message, $transaction_obj) = $ticket->Correspond(MIMEObj=>$parser->Entity);
-ok($id, "conduct transaction? $message");
+ok($id, "conduct transaction 1? $message");
ok($ticket->Subject =~ /\Q[foo.example #12]\E/, "Tag was added to ticket's subject");
+# check to make sure it doesn't add the tag a second time
+($id, $message, $transaction_obj) = $ticket->Correspond(MIMEObj=>$parser->Entity);
+ok($id, "conduct transaction 2? $message");
+#it feels like a kludge but it works
+my $match_count = 0;
+my $subject = $ticket->Subject;
+while ($subject =~ /\Q[foo.example #12]\E/g) { $match_count++; }
+ok($match_count eq 1, "Tag was not added a second time");
+
+
1;
More information about the Rt-commit
mailing list