[Rt-commit] rt branch, 4.2/fixup-default-scrips, updated. rt-4.1.8-558-g2929fa6
Thomas Sibley
trs at bestpractical.com
Wed Jun 12 14:53:56 EDT 2013
The branch, 4.2/fixup-default-scrips has been updated
via 2929fa6af8283104c50d3acaeec636593d2a5e99 (commit)
from 8cf495e243fea410675ee8b0fe8bfe1213c8665b (commit)
Summary of changes:
t/mail/sendmail-plaintext.t | 12 +++++++-----
t/mail/sendmail.t | 12 +++++++-----
t/web/crypt-gnupg.t | 14 +++++++++++---
t/web/scrips.t | 4 ++--
4 files changed, 27 insertions(+), 15 deletions(-)
- Log -----------------------------------------------------------------
commit 2929fa6af8283104c50d3acaeec636593d2a5e99
Author: Thomas Sibley <trs at bestpractical.com>
Date: Wed Jun 12 11:52:49 2013 -0700
Fix broken assumptions about scrips in tests
Caused by the new scrip action and new recipients of the default scrips.
diff --git a/t/mail/sendmail-plaintext.t b/t/mail/sendmail-plaintext.t
index 6bb8bb7..39f26cb 100644
--- a/t/mail/sendmail-plaintext.t
+++ b/t/mail/sendmail-plaintext.t
@@ -2,7 +2,7 @@ use strict;
use warnings;
use File::Spec ();
-use RT::Test tests => 142, text_templates => 1;
+use RT::Test tests => undef, text_templates => 1;
use RT::EmailParser;
use RT::Tickets;
@@ -61,7 +61,7 @@ like (first_txn($tick)->Content , qr/The original message was received/, "It's t
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
undef @scrips_fired;
@@ -89,7 +89,7 @@ ok ($tick->Id, "found ticket ".$tick->Id);
is ($tick->Subject , 'I18NTest', "failed to create the new ticket from an unprivileged account");
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
# make sure it sends a notification to adminccs
@@ -124,7 +124,7 @@ like (first_txn($tick)->Content , qr/H\x{e5}vard/, "It's signed by havard. yay")
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
@@ -166,7 +166,7 @@ like (first_txn($tick)->Content , qr/H\x{e5}vard/, "It's signed by havard. yay")
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
@@ -544,3 +544,5 @@ diag q{regression test for #5248 from rt3.fsck.com};
# Don't taint the environment
$everyone->PrincipalObj->RevokeRight(Right =>'SuperUser');
+
+done_testing;
diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 327d2ad..4cce776 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -2,7 +2,7 @@ use strict;
use warnings;
use File::Spec ();
-use RT::Test tests => 174;
+use RT::Test tests => undef;
use RT::EmailParser;
use RT::Tickets;
@@ -61,7 +61,7 @@ like (first_txn($tick)->Content , qr/The original message was received/, "It's t
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
undef @scrips_fired;
@@ -89,7 +89,7 @@ ok ($tick->Id, "found ticket ".$tick->Id);
is ($tick->Subject , 'I18NTest', "failed to create the new ticket from an unprivileged account");
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
# make sure it sends a notification to adminccs
@@ -124,7 +124,7 @@ like (first_txn($tick)->Content , qr/H\x{e5}vard/, "It's signed by havard. yay")
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
@@ -166,7 +166,7 @@ like (first_txn($tick)->Content , qr/H\x{e5}vard/, "It's signed by havard. yay")
# make sure it fires scrips.
-is ($#scrips_fired, 1, "Fired 2 scrips on ticket creation");
+is (scalar @scrips_fired, 4, "Fired 4 scrips on ticket creation");
# make sure it sends an autoreply
@@ -556,3 +556,5 @@ diag q{regression test for #5248 from rt3.fsck.com};
# Don't taint the environment
$everyone->PrincipalObj->RevokeRight(Right =>'SuperUser');
+
+done_testing;
diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index 220a202..1ad633a 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -2,7 +2,7 @@ use strict;
use warnings;
use RT::Test::GnuPG
- tests => 101,
+ tests => undef,
gnupg_options => {
passphrase => 'recipient',
'trust-model' => 'always',
@@ -351,8 +351,13 @@ $nokey->PrincipalObj->GrantRight(Right => 'CreateTicket');
$nokey->PrincipalObj->GrantRight(Right => 'OwnTicket');
my $tick = RT::Ticket->new( RT->SystemUser );
-$tick->Create(Subject => 'owner lacks pubkey', Queue => 'general',
- Owner => $nokey);
+warning_like {
+ $tick->Create(Subject => 'owner lacks pubkey', Queue => 'general',
+ Owner => $nokey);
+} [
+ qr/nokey\@example.com: skipped: public key not found/,
+ qr/Recipient 'nokey\@example.com' is unusable/,
+];
ok(my $id = $tick->id, 'created ticket for owner-without-pubkey');
$tick = RT::Ticket->new( RT->SystemUser );
@@ -456,3 +461,6 @@ like($content, qr/KR-nokey \(no pubkey!\)-K/,
$m->next_warning_like(qr/public key not found/);
$m->next_warning_like(qr/public key not found/);
$m->no_leftover_warnings_ok;
+
+undef $m;
+done_testing;
diff --git a/t/web/scrips.t b/t/web/scrips.t
index c1b9782..d669f4c 100644
--- a/t/web/scrips.t
+++ b/t/web/scrips.t
@@ -60,8 +60,8 @@ sub prepare_code_with_value {
$m->form_name('CreateScrip');
$m->set_fields(
'ScripCondition' => $condition,
- 'ScripAction' => 15, # User Defined
- 'Template' => 1, # Blank
+ 'ScripAction' => 'User Defined',
+ 'Template' => 'Blank',
'CustomPrepareCode' => $prepare_code,
);
$m->click('Create');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list