[Rt-commit] rt branch, rightsmatrix, updated. rt-3.8.8-670-g1413380

Thomas Sibley trs at bestpractical.com
Thu Sep 2 17:08:53 EDT 2010


The branch, rightsmatrix has been updated
       via  14133808d00cfd8d491146c87b1b5e7821ac2e26 (commit)
       via  59495e5d534a4965b621df8a9a380a04a7a95c8a (commit)
       via  e59ede55dc00af2ae1f701feac8447bc3bc34674 (commit)
       via  471d0739c45d4ddc45a4c6cd7c1e843bd702740e (commit)
       via  d9c81ab0a121e6f7d80f38c7e5bb7c4d3f58192c (commit)
       via  a74a206dcb6f1804f4ea94a8a34d3a955bae5f37 (commit)
       via  801cd2dfc4f7aca3d500d752975b625fb9160dab (commit)
       via  1e2fde0beae175846069d8ca90e2516932030879 (commit)
       via  1aaec46a9ccb1a543827ad6e0ab66f7cc83edc66 (commit)
       via  541a36b52a2594f2e3d8e0c3726a31ceeb6139dc (commit)
       via  6e3077e7294b192e45ea1ac87a3d2af7ae5d7d79 (commit)
       via  0994d141c4bb5ce9cd6314e9fbada15b1a5bd525 (commit)
       via  705e2e5c3c48e2479e0813d84eb126b979b8d9dc (commit)
       via  9c6bd46306e87778f47615a0cd40250d9e7f15c6 (commit)
       via  9b6adc40ba4d1c81f72a216d4b8e30657f226658 (commit)
       via  bf5702f332664060202bfceb280c1a474ef41c26 (commit)
       via  62aa2c1906e027cfacef553b5d85d03196d5f1c0 (commit)
       via  3dd45c716ac71f2a4a895bf869b38dba7c6548ae (commit)
       via  ad5107929a95f5fdf4c297d37dbf22a368aec730 (commit)
       via  2a7b6217d5229244b1deec33344e15051dd38cbf (commit)
       via  2074dead3152c9e5733b273b58b79c9e800f40e9 (commit)
       via  8fee0567b77999af67ae7bbd004811c74141ceed (commit)
       via  5a3d2ef39494f58df5b9812321d26235147dde03 (commit)
       via  f7b96a8c59005251ac7c579c119b1362686e1663 (commit)
       via  654ce58c77177b5115ea52f87e9321c784ce2e03 (commit)
       via  f9e3cc84058a99ac3888d4d71cdf4b09ae125624 (commit)
       via  d9bc12f57cc0c60fae2cb94b1741c7b804748a0b (commit)
       via  6dd331bb7b212608f882cd7fb718133298f4fa99 (commit)
       via  1018f2e035e81db4748bbc5a2422b2630a61108d (commit)
       via  c7e8cfd5bdf7cf2eed16b089f4639ea38be3b386 (commit)
       via  d6bfbe848711931b3663697401d0adaa7cbcaf20 (commit)
       via  f3c1636453f992364ebec21038010c7368b56a6e (commit)
       via  adc33c741553b09aba5619de76db9fa8c461d10e (commit)
       via  a4376680a4bd53c87aee7895d3c599c7731215ff (commit)
       via  194fb2795c4b9c8fdb02dc4b9e3080cef27bc249 (commit)
       via  bd16e7899800b095d7f2783f5d8b4001ea576087 (commit)
       via  679ebad764d4a157edbb9fdfa9fe773d4a401836 (commit)
       via  53c97fa231591b6c0b2ebea7bf9e9614c749771b (commit)
       via  33456b17d3a375f31e73d0cae51e37f6e12d190c (commit)
       via  c42967a54d2b548357216f999d201b98697d52ca (commit)
       via  bc36a06fd8e558c012991e4881d39718bef30ff6 (commit)
       via  0963103f2319898ea5f13922de32de44056d6dee (commit)
       via  833b37f721c0d5d3a06a2bd8099615e8cfc8f705 (commit)
       via  3918a10c531c589f11bf4de9e69e73530431e087 (commit)
       via  c45f33b4252a4b5d03c2c9c41c8fc0e79a78bdf9 (commit)
       via  c6ec2173f5a2bb6f8e6b13d260763bd7fa2a9226 (commit)
       via  7e003fdf4f7f94df03475ff6ce71e7a6ff02d572 (commit)
       via  4720b9ec23edc81f717a9658cb3f2b044f4dd7ac (commit)
       via  9ad38c72cf041c056de9085f908871d7aa2f0a28 (commit)
       via  457c0c59ad3b68bdafc812a0b4113f8c5dd10bc5 (commit)
       via  fbf4284cbff7c6b1e151a025575d896e5c311dbe (commit)
       via  5f3d5f5a168b2f6de8f9885228495a8f20be3f7f (commit)
       via  352c30c1183a81423b1b4f95ca3dbf6866c6c834 (commit)
       via  f8472ba732e81edf09c986f58773858b4aed8186 (commit)
       via  a673b517faaee6a574069e3e10f6ad91b2a34f05 (commit)
       via  127e089ddd037fa950a328376eb83b860db7f599 (commit)
       via  b248487ab36c4b802fb94a402bfd14a172ec2b39 (commit)
      from  ec2817c0918e961e3ea92c240a88d7fde3b4243f (commit)

Summary of changes:
 bin/rt-crontool.in                                 |  131 ++++++++++++++---
 bin/rt.in                                          |   27 ++++
 etc/acl.mysql                                      |    6 +-
 lib/RT.pm.in                                       |    1 -
 lib/RT/Date.pm                                     |    7 +-
 lib/RT/Installer.pm                                |   57 +++-----
 lib/RT/SavedSearches.pm                            |    7 +
 lib/RT/Test.pm                                     |   97 +++++++++----
 lib/RT/Test/Email.pm                               |    3 +-
 lib/RT/Test/Web.pm                                 |   44 +++++-
 lib/RT/URI.pm                                      |    1 +
 sbin/rt-email-digest.in                            |   53 ++++++-
 share/html/Elements/ColumnMap                      |    2 +-
 share/html/Elements/ScrubHTML                      |    1 +
 share/html/Elements/SelectTimezone                 |   23 +--
 ...ditor.original.html => fckeditor.html.original} |    0
 share/html/Ticket/Create.html                      |    3 +-
 share/html/Ticket/Display.html                     |    9 +-
 share/html/Ticket/Elements/Bookmark                |    4 +-
 share/html/Ticket/Elements/ShowRequestorExtraInfo  |    2 +-
 share/html/Widgets/Form/Integer                    |    2 +-
 t/00-compile.t                                     |    3 +-
 t/00-mason-syntax.t                                |    2 +-
 t/api/ace.t                                        |    3 +-
 t/api/action-createtickets.t                       |    1 -
 t/api/attachment.t                                 |    3 +-
 t/api/attribute-tests.t                            |    5 +-
 t/api/attribute.t                                  |    3 +-
 t/api/condition-ownerchange.t                      |    1 -
 t/api/condition-reject.t                           |    1 -
 t/api/config.t                                     |    2 +-
 t/api/currentuser.t                                |    3 +-
 t/api/customfield.t                                |    3 +-
 t/api/date.t                                       |    5 +-
 t/api/emailparser.t                                |    3 +-
 t/api/group.t                                      |    3 +-
 t/api/groups.t                                     |    3 +-
 t/api/i18n.t                                       |    3 +-
 t/api/link.t                                       |    3 +-
 t/api/queue.t                                      |    3 +-
 t/api/record.t                                     |    1 -
 t/api/reminders.t                                  |    2 +-
 t/api/rights.t                                     |    2 +-
 t/api/rights_show_ticket.t                         |    2 +-
 t/api/rt.t                                         |    3 +-
 t/api/scrip.t                                      |    1 -
 t/api/scrip_order.t                                |    1 -
 t/api/searchbuilder.t                              |    1 -
 t/api/system.t                                     |    3 +-
 t/api/template.t                                   |    1 -
 t/api/ticket.t                                     |    1 -
 t/api/tickets.t                                    |    1 -
 t/api/tickets_overlay_sql.t                        |    1 -
 t/api/uri-fsck_com_rt.t                            |    1 -
 t/api/uri-t.t                                      |    1 -
 t/api/user.t                                       |    1 -
 t/api/users.t                                      |    1 -
 t/approval/basic.t                                 |   11 +-
 t/clicky.t                                         |    2 +-
 t/cron.t                                           |    3 +-
 t/customfields/access_via_queue.t                  |    2 +-
 t/{api/cf.t => customfields/api.t}                 |    2 +-
 .../combo_cascade.t}                               |    3 +-
 .../date_search.t}                                 |    6 +-
 .../datetime_search.t}                             |   12 +-
 t/{api/cf_external.t => customfields/external.t}   |    0
 t/{api/cf_pattern.t => customfields/pattern.t}     |    2 +-
 .../single_values.t}                               |    3 +-
 .../transaction.t}                                 |    2 +-
 t/delegation/cleanup_stalled.t                     |    2 +-
 t/delegation/revocation.t                          |    2 +-
 t/i18n/default.t                                   |    2 +-
 t/mail/crypt-gnupg.t                               |   40 +++++-
 t/mail/gateway.t                                   |   61 +++++++-
 t/mail/gnupg-bad.t                                 |    6 +-
 t/mail/gnupg-incoming.t                            |   19 +--
 t/{web => mail}/gnupg-outgoing.t                   |   71 +--------
 t/mail/gnupg-realmail.t                            |    7 +-
 t/mail/gnupg-reverification.t                      |   33 ++++-
 t/mail/gnupg-special.t                             |    6 +-
 t/mail/mime_decoding.t                             |    2 +-
 t/mail/sendmail.t                                  |  101 +++++++-------
 t/mail/verp.t                                      |    2 +-
 t/mail/wrong_mime_charset.t                        |    2 +-
 t/shredder/00load.t                                |    2 +-
 t/shredder/03plugin_summary.t                      |    2 +-
 t/shredder/03plugin_users.t                        |    2 +-
 t/ticket/action_linear_escalate.t                  |    3 -
 t/ticket/add-watchers.t                            |    2 +-
 t/ticket/batch-upload-csv.t                        |    1 -
 t/ticket/cfsort-freeform-multiple.t                |    2 +-
 t/ticket/cfsort-freeform-single.t                  |    2 +-
 t/ticket/deferred_owner.t                          |    2 +-
 t/ticket/link_search.t                             |    2 -
 t/ticket/search.t                                  |    2 +-
 t/ticket/search_by_cf_freeform_multiple.t          |    2 +-
 t/ticket/search_by_cf_freeform_single.t            |    2 +-
 t/ticket/search_by_links.t                         |    2 +-
 t/ticket/search_by_watcher.t                       |    2 +-
 t/ticket/search_long_cf_values.t                   |    2 +-
 t/ticket/sort-by-custom-ownership.t                |    2 +-
 t/ticket/sort-by-queue.t                           |    2 +-
 t/ticket/sort-by-user.t                            |    2 +-
 t/ticket/sort_by_cf.t                              |    2 +-
 t/web/basic.t                                      |    2 -
 t/web/command_line.t                               |    4 +-
 t/web/command_line_with_unknown_field.t            |    2 +
 t/web/compilation_errors.t                         |    3 +-
 t/web/config_tab_right.t                           |    2 +-
 t/web/crypt-gnupg.t                                |   26 +++-
 t/web/dashboards-groups.t                          |    2 +-
 t/web/dashboards-permissions.t                     |    2 +-
 t/web/gnupg-select-keys-on-create.t                |   21 ++-
 t/web/gnupg-select-keys-on-update.t                |   23 +++-
 t/web/gnupg-tickyboxes.t                           |  155 ++++++++++++++++++++
 t/web/query_builder.t                              |    1 -
 t/web/requestor_groups_limit.t                     |    8 +-
 t/web/rights1.t                                    |    3 +-
 t/web/ticket_owner.t                               |    2 +-
 t/web/ticket_owner_autocomplete.t                  |    4 +-
 t/web/ticket_seen.t                                |    2 +-
 121 files changed, 832 insertions(+), 431 deletions(-)
 rename share/html/NoAuth/RichText/FCKeditor/editor/{fckeditor.original.html => fckeditor.html.original} (100%)
 rename t/{api/cf.t => customfields/api.t} (99%)
 rename t/{api/cf_combo_cascade.t => customfields/combo_cascade.t} (96%)
 rename t/{api/cf_date_search.t => customfields/date_search.t} (94%)
 rename t/{api/cf_datetime_search.t => customfields/datetime_search.t} (92%)
 rename t/{api/cf_external.t => customfields/external.t} (100%)
 rename t/{api/cf_pattern.t => customfields/pattern.t} (97%)
 rename t/{api/cf_single_values.t => customfields/single_values.t} (95%)
 rename t/{api/cf_transaction.t => customfields/transaction.t} (97%)
 rename t/{web => mail}/gnupg-outgoing.t (80%)
 create mode 100644 t/web/gnupg-tickyboxes.t

- Log -----------------------------------------------------------------
commit b248487ab36c4b802fb94a402bfd14a172ec2b39
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Aug 26 13:05:50 2010 -0400

    Disable startup lexicon parsing in favor of lazy runtime
    parsing, for great test performance justice.

diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index e7b63b0..99436aa 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -497,7 +497,6 @@ sub InitClasses {
             );
         }
 
-        #RT::I18N->LoadLexicons;
     }
 }
 

commit 127e089ddd037fa950a328376eb83b860db7f599
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Aug 26 17:49:41 2010 -0400

    CreatedBy's database field is Creator
    
    Trying to sort a collection list by Created By generated an invalid
    query which then displayed an empty list.

diff --git a/share/html/Elements/ColumnMap b/share/html/Elements/ColumnMap
index d0dfe6d..46ce652 100644
--- a/share/html/Elements/ColumnMap
+++ b/share/html/Elements/ColumnMap
@@ -72,7 +72,7 @@ my $COLUMN_MAP = {
         value     => sub { return $_[0]->CreatedObj->AgeAsString }
     },
     CreatedBy => {
-        attribute => 'CreatedBy',
+        attribute => 'Creator',
         title     => 'Created By', # loc
         value     => sub { return $_[0]->CreatorObj->Name }
     },

commit a673b517faaee6a574069e3e10f6ad91b2a34f05
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Aug 26 18:18:56 2010 -0400

    We pass these ColumnMap values through Mason, so don't escape them just yet

diff --git a/share/html/Ticket/Elements/ShowRequestorExtraInfo b/share/html/Ticket/Elements/ShowRequestorExtraInfo
index 4916937..5efa8be 100644
--- a/share/html/Ticket/Elements/ShowRequestorExtraInfo
+++ b/share/html/Ticket/Elements/ShowRequestorExtraInfo
@@ -80,7 +80,7 @@ my $fetch_columnmap = sub {
             Name  => $name,
             Attr  => $attr,
             );
-    return ProcessColumnMapValue( $tmp, Arguments => $arguments );
+    return ProcessColumnMapValue( $tmp, Arguments => $arguments, Escape => 0 );
 };
 </%INIT>
 <%ARGS>

commit f8472ba732e81edf09c986f58773858b4aed8186
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 27 10:05:02 2010 +0800

    use loose check: it's not sure about thr order

diff --git a/t/web/requestor_groups_limit.t b/t/web/requestor_groups_limit.t
index 768af97..9650773 100644
--- a/t/web/requestor_groups_limit.t
+++ b/t/web/requestor_groups_limit.t
@@ -20,8 +20,8 @@ ok( $id, 'created ticket' );
 my ( $url, $m ) = RT::Test->started_ok;
 ok( $m->login(), 'logged in as root' );
 $m->get_ok( $url . '/Ticket/Display.html?id=' . $id );
-$m->content_contains( 'Everyone', 'got the first group' );
-$m->content_lacks( 'Privileged', 'not the second group' );
+$m->content_like( qr/Everyone|Privileged/, 'got one group' );
+$m->content_unlike( qr/Everyone.*?Privileged/, 'not 2 groups' );
 
 RT::Test->stop_server;
 

commit 352c30c1183a81423b1b4f95ca3dbf6866c6c834
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 22:50:40 2010 -0400

    Silence some gpg warnings in gnupg-incoming

diff --git a/t/mail/gnupg-incoming.t b/t/mail/gnupg-incoming.t
index 230aa9c..5a841a7 100644
--- a/t/mail/gnupg-incoming.t
+++ b/t/mail/gnupg-incoming.t
@@ -79,7 +79,7 @@ my $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --armor --sign),
+        qw(gpg --batch --no-tty --armor --sign),
         '--default-key' => 'recipient at example.com',
         '--homedir'     => $homedir,
         '--passphrase'  => 'recipient',
@@ -121,7 +121,7 @@ $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --armor --sign --clearsign),
+        qw(gpg --batch --no-tty --armor --sign --clearsign),
         '--default-key' => 'recipient at example.com',
         '--homedir'     => $homedir,
         '--passphrase'  => 'recipient',
@@ -162,7 +162,7 @@ $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --encrypt --armor --sign),
+        qw(gpg --batch --no-tty --encrypt --armor --sign),
         '--recipient'   => 'general at example.com',
         '--default-key' => 'recipient at example.com',
         '--homedir'     => $homedir,
@@ -211,7 +211,7 @@ $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --armor --sign),
+        qw(gpg --batch --no-tty --armor --sign),
         '--default-key' => 'rt at example.com',
         '--homedir'     => $homedir,
         '--passphrase'  => 'test',
@@ -247,7 +247,7 @@ $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --armor --encrypt),
+        qw(gpg --batch --no-tty --armor --encrypt),
         '--recipient'   => 'random at localhost',
         '--homedir'     => $homedir,
     ),
@@ -284,7 +284,7 @@ $buf = '';
 
 run3(
     shell_quote(
-        qw(gpg --armor --encrypt),
+        qw(gpg --batch --no-tty --armor --encrypt),
         '--recipient'   => 'rt at example.com',
         '--homedir'     => $homedir,
     ),

commit 5f3d5f5a168b2f6de8f9885228495a8f20be3f7f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 23:16:46 2010 -0400

    Silence some warnings caused by get instead of get_ok

diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 24df427..9263a75 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 39;
+use RT::Test tests => 41;
 use JSON qw(from_json);
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
@@ -144,7 +144,7 @@ diag "on reply correct owner is selected";
 sub autocomplete {
     my $limit = shift;
     my $agent = shift;
-    $agent->get("/Helpers/Autocomplete/Owners?term=&limit=$limit&return=Name", "fetched autocomplete values");
+    $agent->get_ok("/Helpers/Autocomplete/Owners?term=&limit=$limit&return=Name", "fetched autocomplete values");
     return from_json($agent->content);
 }
 

commit fbf4284cbff7c6b1e151a025575d896e5c311dbe
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 23:18:17 2010 -0400

    Fix most spewage in compilation_errors

diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index db4e1a7..7d4c2b3 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -50,7 +50,7 @@ sub test_get {
 
         $file =~ s#^share/html/##;
         diag( "testing $url/$file" );
-        ok ($agent->get("$url/$file", "GET $url/$file"), "Can Get $url/$file");
+        $agent->get_ok("$url/$file");
         is ($agent->{'status'}, 200, "Loaded $file");
 #        ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file ");
         ok( $agent->{'content'} !~ /Not logged in/i, "Still logged in for  $file");

commit 457c0c59ad3b68bdafc812a0b4113f8c5dd10bc5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 23:42:23 2010 -0400

    diag checks TEST_VERBOSE now

diff --git a/t/web/requestor_groups_limit.t b/t/web/requestor_groups_limit.t
index 9650773..dd321cb 100644
--- a/t/web/requestor_groups_limit.t
+++ b/t/web/requestor_groups_limit.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::Test tests => 11;
 
-diag "set groups limit to 1" if $ENV{TEST_VERBOSE};
+diag "set groups limit to 1";
 RT->Config->Set( ShowMoreAboutPrivilegedUsers    => 1 );
 RT->Config->Set( MoreAboutRequestorGroupsLimit => 1 );
 
@@ -25,7 +25,7 @@ $m->content_unlike( qr/Everyone.*?Privileged/, 'not 2 groups' );
 
 RT::Test->stop_server;
 
-diag "set groups limit to 2" if $ENV{TEST_VERBOSE};
+diag "set groups limit to 2";
 
 RT->Config->Set( MoreAboutRequestorGroupsLimit => 2 );
 ( $url, $m ) = RT::Test->started_ok;

commit 9ad38c72cf041c056de9085f908871d7aa2f0a28
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 23:44:12 2010 -0400

    Clear @SERVERS when we stop the server
    
        This incidentally silences a warning in t/web/requestor_groups_limit.t :)

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 546dd48..448e5d0 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -1242,6 +1242,8 @@ sub stop_server {
     foreach my $pid (@SERVERS) {
         waitpid $pid, 0;
     }
+
+    @SERVERS = ();
 }
 
 sub file_content {

commit 4720b9ec23edc81f717a9658cb3f2b044f4dd7ac
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Aug 27 00:09:57 2010 -0400

    Avoid undef warnings when scrubbing

diff --git a/share/html/Elements/ScrubHTML b/share/html/Elements/ScrubHTML
index d475bc6..eabbfd5 100644
--- a/share/html/Elements/ScrubHTML
+++ b/share/html/Elements/ScrubHTML
@@ -70,6 +70,7 @@ $scrubber->allow(
 $scrubber->comment(0);
 </%ONCE>
 <%init>
+$Content = '' if !defined($Content);
 return $scrubber->scrub($Content);
 </%init>
 <%args>

commit 7e003fdf4f7f94df03475ff6ce71e7a6ff02d572
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Aug 27 00:24:13 2010 -0400

    Remove a bunch of useless "1;"s at the ends of test files

diff --git a/t/00-compile.t b/t/00-compile.t
index 1a89e77..1baf74c 100644
--- a/t/00-compile.t
+++ b/t/00-compile.t
@@ -52,4 +52,3 @@ for (@files) {
     require_ok($_);
 }
 
-1;
diff --git a/t/api/ace.t b/t/api/ace.t
index 4031046..cb3e342 100644
--- a/t/api/ace.t
+++ b/t/api/ace.t
@@ -235,4 +235,3 @@ ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b does not
 
 }
 
-1;
diff --git a/t/api/action-createtickets.t b/t/api/action-createtickets.t
index 69ceb8d..a723a70 100644
--- a/t/api/action-createtickets.t
+++ b/t/api/action-createtickets.t
@@ -237,4 +237,3 @@ foreach my $id ( sort keys %expected ) {
 
 }
 
-1;
diff --git a/t/api/attachment.t b/t/api/attachment.t
index 07c46ba..f6732e9 100644
--- a/t/api/attachment.t
+++ b/t/api/attachment.t
@@ -42,4 +42,3 @@ is ($#headers, 2, "testing a bunch of singline multiple headers" );
 
 }
 
-1;
diff --git a/t/api/attribute-tests.t b/t/api/attribute-tests.t
index 90c3ddb..747d1eb 100644
--- a/t/api/attribute-tests.t
+++ b/t/api/attribute-tests.t
@@ -81,6 +81,3 @@ ok(1, $attr->BuildSelectQuery);
 @names = $attr->Names;
 is("@names", "TestAttr");
 
-
-
-1;
diff --git a/t/api/attribute.t b/t/api/attribute.t
index cb2626a..bbd96da 100644
--- a/t/api/attribute.t
+++ b/t/api/attribute.t
@@ -39,4 +39,3 @@ is ($id, 0);
 
 }
 
-1;
diff --git a/t/api/cf_combo_cascade.t b/t/api/cf_combo_cascade.t
index b37345a..52fa54a 100644
--- a/t/api/cf_combo_cascade.t
+++ b/t/api/cf_combo_cascade.t
@@ -43,4 +43,3 @@ is($cfv->Category, '1. Category A');
 works($cfv->SetCategory('1. Category AAA'));
 is($cfv->Category, '1. Category AAA');
 
-1;
diff --git a/t/api/cf_single_values.t b/t/api/cf_single_values.t
index 8e96edd..24e8ef4 100644
--- a/t/api/cf_single_values.t
+++ b/t/api/cf_single_values.t
@@ -35,4 +35,3 @@ is($t->CustomFieldValues($cf->id)->Count, 1, "One now");
 $t->AddCustomFieldValue(Field => $cf->id, Value => 'Second');
 is($t->CustomFieldValues($cf->id)->Count, 1, "Still one");
 
-1;
diff --git a/t/api/condition-ownerchange.t b/t/api/condition-ownerchange.t
index 4c4c49b..afa801a 100644
--- a/t/api/condition-ownerchange.t
+++ b/t/api/condition-ownerchange.t
@@ -48,4 +48,3 @@ is ($ticket->Priority , '24', "Ticket priority is set right");
 
 }
 
-1;
diff --git a/t/api/condition-reject.t b/t/api/condition-reject.t
index 9678950..e5ce719 100644
--- a/t/api/condition-reject.t
+++ b/t/api/condition-reject.t
@@ -42,4 +42,3 @@ is ($ticket->Priority , '21', "Condition is false, scrip skipped");
 
 }
 
-1;
diff --git a/t/api/currentuser.t b/t/api/currentuser.t
index c158048..cd3e776 100644
--- a/t/api/currentuser.t
+++ b/t/api/currentuser.t
@@ -29,4 +29,3 @@ SKIP: {
 
 }
 
-1;
diff --git a/t/api/customfield.t b/t/api/customfield.t
index 44319c4..41d35ef 100644
--- a/t/api/customfield.t
+++ b/t/api/customfield.t
@@ -71,4 +71,3 @@ ok(!$cf->ValidateType('SelectFooMultiple'));
 
 }
 
-1;
diff --git a/t/api/emailparser.t b/t/api/emailparser.t
index 940c26f..00c2a82 100644
--- a/t/api/emailparser.t
+++ b/t/api/emailparser.t
@@ -16,4 +16,3 @@ my @before = ("rt\@example.com", "frt\@example.com");
 my @after = ("frt\@example.com");
 ok(eq_array(RT::EmailParser::CullRTAddresses("", at before), at after), "CullRTAddresses only culls RT addresses");
 
-1;
diff --git a/t/api/group.t b/t/api/group.t
index 551d4f1..1e4fb38 100644
--- a/t/api/group.t
+++ b/t/api/group.t
@@ -96,4 +96,3 @@ is($u->PrincipalObj->PrincipalType , 'Group' , "Principal 4 is a group");
 
 }
 
-1;
diff --git a/t/api/groups.t b/t/api/groups.t
index 9a482f5..e0c398a 100644
--- a/t/api/groups.t
+++ b/t/api/groups.t
@@ -130,4 +130,3 @@ is($groups->Count, 1, "RTxGroupRight found for RTxObj2");
 
 }
 
-1;
diff --git a/t/api/i18n.t b/t/api/i18n.t
index 17d71b7..dcfe050 100644
--- a/t/api/i18n.t
+++ b/t/api/i18n.t
@@ -27,4 +27,3 @@ is($en->encoding , 'utf-8', "The encoding ".$en->encoding." is 'utf-8'");
 
 }
 
-1;
diff --git a/t/api/link.t b/t/api/link.t
index 0903525..47a839f 100644
--- a/t/api/link.t
+++ b/t/api/link.t
@@ -218,4 +218,3 @@ sub clean_links {
     }
 }
 
-1;
diff --git a/t/api/queue.t b/t/api/queue.t
index 44d5caf..97e06b2 100644
--- a/t/api/queue.t
+++ b/t/api/queue.t
@@ -89,4 +89,3 @@ ok ($group->Id, "Found the AdminCc object for this Queue");
 
 }
 
-1;
diff --git a/t/api/record.t b/t/api/record.t
index 6bf1af8..ec7fc85 100644
--- a/t/api/record.t
+++ b/t/api/record.t
@@ -67,4 +67,3 @@ ok($rid, $rmsg);
 
 }
 
-1;
diff --git a/t/api/reminders.t b/t/api/reminders.t
index fd1c6a6..f3d74ef 100644
--- a/t/api/reminders.t
+++ b/t/api/reminders.t
@@ -85,4 +85,4 @@ while ( my $reminder = $reminders->Next ) {
 is($r_resolved, 1, 'Reminder resolved');
 
 }
-1;
+
diff --git a/t/api/rt.t b/t/api/rt.t
index 3c06b58..8c8762c 100644
--- a/t/api/rt.t
+++ b/t/api/rt.t
@@ -15,4 +15,3 @@ isnt ($RT::SystemUser->Name() , 'noname', "The system user isn't noname");
 
 }
 
-1;
diff --git a/t/api/scrip.t b/t/api/scrip.t
index 8e8f962..97e5713 100644
--- a/t/api/scrip.t
+++ b/t/api/scrip.t
@@ -46,4 +46,3 @@ isnt ($ticket2->Priority , '87', "Ticket priority is set right");
 
 }
 
-1;
diff --git a/t/api/scrip_order.t b/t/api/scrip_order.t
index 9738db9..d351741 100644
--- a/t/api/scrip_order.t
+++ b/t/api/scrip_order.t
@@ -53,4 +53,3 @@ is  ($ticket->Priority , 10, "Ticket should be priority 10");
 
 # }}}
 
-1;
diff --git a/t/api/searchbuilder.t b/t/api/searchbuilder.t
index cb11890..f84c601 100644
--- a/t/api/searchbuilder.t
+++ b/t/api/searchbuilder.t
@@ -37,4 +37,3 @@ is_deeply(\@items_ids, \@sorted_ids, "ItemsArrayRef sorts alphabetically by name
 
 }
 
-1;
diff --git a/t/api/system.t b/t/api/system.t
index 3077115..318705a 100644
--- a/t/api/system.t
+++ b/t/api/system.t
@@ -30,4 +30,3 @@ is ($sys->id, 1);
 
 }
 
-1;
diff --git a/t/api/template.t b/t/api/template.t
index 1612b8f..2e39761 100644
--- a/t/api/template.t
+++ b/t/api/template.t
@@ -23,4 +23,3 @@ ok($t2->QueueObj->id, "Got the template's queue objet");
 
 }
 
-1;
diff --git a/t/api/ticket.t b/t/api/ticket.t
index 2ca0997..94d3ef3 100644
--- a/t/api/ticket.t
+++ b/t/api/ticket.t
@@ -254,4 +254,3 @@ ok(!$id,$msg);
 
 }
 
-1;
diff --git a/t/api/tickets.t b/t/api/tickets.t
index 9148a88..a336519 100644
--- a/t/api/tickets.t
+++ b/t/api/tickets.t
@@ -101,4 +101,3 @@ ok( $unlimittickets->Count > 0, "UnLimited tickets object should return tickets"
 
 }
 
-1;
diff --git a/t/api/tickets_overlay_sql.t b/t/api/tickets_overlay_sql.t
index 7980886..2e78340 100644
--- a/t/api/tickets_overlay_sql.t
+++ b/t/api/tickets_overlay_sql.t
@@ -70,4 +70,3 @@ my $string = 'subject/content SQL test';
 
 }
 
-1;
diff --git a/t/api/uri-fsck_com_rt.t b/t/api/uri-fsck_com_rt.t
index d62e580..522bf3f 100644
--- a/t/api/uri-fsck_com_rt.t
+++ b/t/api/uri-fsck_com_rt.t
@@ -25,4 +25,3 @@ $ticket->Load(1);
 $uri = RT::URI::fsck_com_rt->new($ticket->CurrentUser);
 is($uri->LocalURIPrefix. "/ticket/1" , $uri->URIForObject($ticket));
 
-1;
diff --git a/t/api/uri-t.t b/t/api/uri-t.t
index 4695629..32f87c6 100644
--- a/t/api/uri-t.t
+++ b/t/api/uri-t.t
@@ -18,4 +18,3 @@ is($uri->Object->Id, 1, "Object loaded has correct ID");
 is($uri->URI, 'fsck.com-rt://'.RT->Config->Get('Organization').'/ticket/1',
    "URI object has correct URI string");
 
-1;
diff --git a/t/api/user.t b/t/api/user.t
index 25cf747..129b2bf 100644
--- a/t/api/user.t
+++ b/t/api/user.t
@@ -336,4 +336,3 @@ ok($rqv, "Revoked the right successfully - $rqm");
 
 }
 
-1;
diff --git a/t/api/users.t b/t/api/users.t
index ce96e54..2149a5e 100644
--- a/t/api/users.t
+++ b/t/api/users.t
@@ -71,4 +71,3 @@ is($users->Count, 1, "RTxUserRight found for RTxObj2");
 
 }
 
-1;
diff --git a/t/cron.t b/t/cron.t
index 29d7bd7..b8fa0df 100644
--- a/t/cron.t
+++ b/t/cron.t
@@ -87,4 +87,3 @@ my ($trans, $desc, $transaction) = $ticket2->Comment(MIMEObj => $template_obj->M
 my $bogus_action = RT::Action::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, TransactionObj => $transaction, CurrentUser => $CurrentUser);
 ok(!$bogus_action->Prepare(), "Comment aborted to prevent loop");
 
-1;
diff --git a/t/mail/gateway.t b/t/mail/gateway.t
index 6ff1911..bf22147 100644
--- a/t/mail/gateway.t
+++ b/t/mail/gateway.t
@@ -797,6 +797,3 @@ is( $tick->Transactions->Count, 5, "transactions added" );
 # }}}
 };
 
-
-1;
-
diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 539cf9e..06925ef 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -535,4 +535,3 @@ diag q{regression test for #5248 from rt3.fsck.com};
 
 # Don't taint the environment
 $everyone->PrincipalObj->RevokeRight(Right =>'SuperUser');
-1;
diff --git a/t/ticket/action_linear_escalate.t b/t/ticket/action_linear_escalate.t
index 38cd47d..2c042fb 100644
--- a/t/ticket/action_linear_escalate.t
+++ b/t/ticket/action_linear_escalate.t
@@ -60,9 +60,6 @@ escalate_ticket_ok($ticket3);
 ok( $ticket3->LastUpdatedBy == $user->id, "Did not set LastUpdated" );
 ok( $ticket3->Transactions->Last->Type =~ /Create/i, "Did not record a transaction" );
 
-1;
-
-
 sub create_ticket_as_ok {
     my $user = shift;
 
diff --git a/t/ticket/batch-upload-csv.t b/t/ticket/batch-upload-csv.t
index 41dc786..eb2cf1d 100644
--- a/t/ticket/batch-upload-csv.t
+++ b/t/ticket/batch-upload-csv.t
@@ -45,4 +45,3 @@ is($first->FirstCustomFieldValue($cf->id), '2.0');
 my $second = $tix->Next;
 is($second->Subject(), 'hello'); 
 is($second->FirstCustomFieldValue($cf->id), '3.0');
-1;
diff --git a/t/ticket/link_search.t b/t/ticket/link_search.t
index 687c01b..3c4752e 100644
--- a/t/ticket/link_search.t
+++ b/t/ticket/link_search.t
@@ -242,5 +242,3 @@ ok( $has{$parentid}, "The collection has our parent");
 ok( $has{$grand_childid}, "The collection have our child");
 ok( !$has{$unlinked_id}, "unlinked is not in collection");
 
-
-1;
diff --git a/t/web/basic.t b/t/web/basic.t
index 338bed9..d170c84 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -134,5 +134,3 @@ $query =~ s/\s+/ /g;
 
 is ($query, "Subject LIKE 'aaa' AND Subject LIKE 'bbb'");
 
-
-1;
diff --git a/t/web/command_line.t b/t/web/command_line.t
index 8904519..d32677a 100644
--- a/t/web/command_line.t
+++ b/t/web/command_line.t
@@ -540,6 +540,3 @@ sub check_attachment {
     }
 }
 
-
-
-1;
diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index 7d4c2b3..6bc0358 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -61,4 +61,3 @@ sub test_get {
         };
 }
 
-1;
diff --git a/t/web/query_builder.t b/t/web/query_builder.t
index 153cb81..bb38a8b 100644
--- a/t/web/query_builder.t
+++ b/t/web/query_builder.t
@@ -244,4 +244,3 @@ diag "input a condition, select (several conditions), click delete";
     );
 }
 
-1;
diff --git a/t/web/rights1.t b/t/web/rights1.t
index c8892f2..0b00c27 100644
--- a/t/web/rights1.t
+++ b/t/web/rights1.t
@@ -107,4 +107,3 @@ ok($agent->form_name('BuildQuery'), "Yep, form is still there");
 my $input = $agent->current_form->find_input('ValueOfActor');
 ok(grep(/customer-$$/, $input->value_names()), "Found self in the actor listing");
 
-1;

commit c6ec2173f5a2bb6f8e6b13d260763bd7fa2a9226
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Aug 27 01:12:33 2010 -0400

    Add some helper functions for progressively testing warnings

diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index a3fdf0d..37ef90c 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -196,6 +196,26 @@ sub warning_like {
     return Test::More::like($warnings[0], $re, $name);
 }
 
+sub next_warning_like {
+    my $self = shift;
+    my $re   = shift;
+    my $name = shift;
+
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+    if (@{ $self->{stashed_server_warnings} || [] } == 0) {
+        my @warnings = $self->get_warnings;
+        if (@warnings == 0) {
+            Test::More::fail("no warnings emitted; expected 1");
+            return 0;
+        }
+        $self->{stashed_server_warnings} = \@warnings;
+    }
+
+    my $warning = shift @{ $self->{stashed_server_warnings} };
+    return Test::More::like($warning, $re, $name);
+}
+
 sub no_warnings_ok {
     my $self = shift;
     my $name = shift || "no warnings emitted";
@@ -212,4 +232,21 @@ sub no_warnings_ok {
     return @warnings == 0 ? 1 : 0;
 }
 
+sub no_leftover_warnings_ok {
+    my $self = shift;
+
+    my $name = shift || "no leftover warnings";
+
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+    my @warnings = @{ $self->{stashed_server_warnings} || [] };
+
+    Test::More::is(@warnings, 0, $name);
+    for (@warnings) {
+        Test::More::diag("leftover warning: $_");
+    }
+
+    return @warnings == 0 ? 1 : 0;
+}
+
 1;

commit c45f33b4252a4b5d03c2c9c41c8fc0e79a78bdf9
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Aug 27 01:19:51 2010 -0400

    Clear leftover warnings during no_leftover_warnings_ok

diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 37ef90c..feff736 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -239,7 +239,9 @@ sub no_leftover_warnings_ok {
 
     local $Test::Builder::Level = $Test::Builder::Level + 1;
 
-    my @warnings = @{ $self->{stashed_server_warnings} || [] };
+    # we clear the warnings because we don't want to break later tests
+    # in case there *are* leftover warnings
+    my @warnings = splice @{ $self->{stashed_server_warnings} || [] };
 
     Test::More::is(@warnings, 0, $name);
     for (@warnings) {

commit 3918a10c531c589f11bf4de9e69e73530431e087
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Aug 27 01:28:23 2010 -0400

    Test warnings in gateway.t

diff --git a/t/mail/gateway.t b/t/mail/gateway.t
index bf22147..c2bd21b 100644
--- a/t/mail/gateway.t
+++ b/t/mail/gateway.t
@@ -57,7 +57,7 @@ use strict;
 use warnings;
 
 
-use RT::Test config => 'Set( $UnsafeEmailCommands, 1);', tests => 159;
+use RT::Test config => 'Set( $UnsafeEmailCommands, 1);', tests => 219;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 use RT::Tickets;
@@ -82,6 +82,7 @@ EOF
     my ($status, $id) = RT::Test->send_via_mailgate_and_http($text, url => undef);
     is ($status >> 8, 1, "The mail gateway exited with a failure");
     ok (!$id, "No ticket id") or diag "by mistake ticket #$id";
+    $m->no_warnings_ok;
 }
 
 diag "Make sure that when we call the mailgate with wrong URL, it tempfails";
@@ -96,6 +97,7 @@ EOF
     my ($status, $id) = RT::Test->send_via_mailgate_and_http($text, url => 'http://this.test.for.non-connection.is.expected.to.generate.an.error');
     is ($status >> 8, 75, "The mail gateway exited with a failure");
     ok (!$id, "No ticket id");
+    $m->no_warnings_ok;
 }
 
 my $everyone_group;
@@ -129,6 +131,7 @@ EOF
     isa_ok ($tick, 'RT::Ticket');
     is ($tick->Id, $id, "correct ticket id");
     is ($tick->Subject , 'This is a test of new ticket creation', "Created the ticket");
+    $m->no_warnings_ok;
 }
 
 diag "Test the 'X-RT-Mail-Extension' field in the header of a ticket";
@@ -165,6 +168,7 @@ EOF
         "bad value with newlines",
         'header is in place, without trailing newline char'
     );
+    $m->no_warnings_ok;
 }
 
 diag "Make sure that not standard --extension is passed";
@@ -198,6 +202,7 @@ EOF
         'some-extension-arg',
         'header is in place'
     );
+    $m->no_warnings_ok;
 }
 
 diag "Test new ticket creation without --action argument";
@@ -218,6 +223,7 @@ EOF
     isa_ok ($tick, 'RT::Ticket');
     is ($tick->Id, $id, "correct ticket id");
     is ($tick->Subject, 'using mailgate without --action arg', "using mailgate without --action arg");
+    $m->no_warnings_ok;
 }
 
 diag "This is a test of new ticket creation as an unknown user";
@@ -242,6 +248,13 @@ EOF
     my $u = RT::User->new($RT::SystemUser);
     $u->Load("doesnotexist\@@{[RT->Config->Get('rtname')]}");
     ok( !$u->Id, "user does not exist and was not created by failed ticket submission");
+
+    $m->next_warning_like(qr/RT's configuration does not allow\s+for the creation of a new user for this email/);
+    TODO: {
+        local $TODO = "we're a bit noisy for this warning case";
+        $m->next_warning_like(qr/Could not load a valid user/);
+        $m->no_leftover_warnings_ok;
+    }
 }
 
 diag "grant everybody with CreateTicket right";
@@ -278,6 +291,7 @@ EOF
     $u->Load( "doesnotexist\@@{[RT->Config->Get('rtname')]}" );
     ok ($u->Id, "user does not exist and was created by ticket submission");
     $ticket_id = $id;
+    $m->no_warnings_ok;
 }
 
 diag "can another random reply to a ticket without being granted privs? answer should be no.";
@@ -297,6 +311,11 @@ EOF
     my $u = RT::User->new($RT::SystemUser);
     $u->Load('doesnotexist-2@'.RT->Config->Get('rtname'));
     ok( !$u->Id, " user does not exist and was not created by ticket correspondence submission");
+    $m->next_warning_like(qr/RT's configuration does not allow\s+for the creation of a new user for this email \(doesnotexist-2\@example\.com\)/);
+    TODO: {
+        local $TODO = "we're a bit noisy for this warning case";
+        $m->no_leftover_warnings_ok;
+    }
 }
 
 diag "grant everyone 'ReplyToTicket' right";
@@ -325,6 +344,7 @@ EOF
     my $u = RT::User->new($RT::SystemUser);
     $u->Load('doesnotexist-2@'.RT->Config->Get('rtname'));
     ok ($u->Id, "user exists and was created by ticket correspondence submission");
+    $m->no_warnings_ok;
 }
 
 diag "add a reply to the ticket using '--extension ticket' feature";
@@ -357,6 +377,7 @@ EOF
     my $attachment = $txn->Attachments->First;
     isa_ok ($attachment, 'RT::Attachment');
     is ($attachment->GetHeader('X-RT-Mail-Extension'), $id, 'header is in place');
+    $m->no_warnings_ok;
 }
 
 diag "can another random comment on a ticket without being granted privs? answer should be no";
@@ -376,6 +397,11 @@ EOF
     my $u = RT::User->new($RT::SystemUser);
     $u->Load('doesnotexist-3@'.RT->Config->Get('rtname'));
     ok( !$u->Id, " user does not exist and was not created by ticket comment submission");
+    $m->next_warning_like(qr/RT's configuration does not allow\s+for the creation of a new user for this email \(doesnotexist-3\@example\.com\)/);
+    TODO: {
+        local $TODO = "we're a bit noisy for this warning case";
+        $m->no_leftover_warnings_ok;
+    }
 }
 
 
@@ -405,6 +431,7 @@ EOF
     my $u = RT::User->new($RT::SystemUser);
     $u->Load('doesnotexist-3@'.RT->Config->Get('rtname'));
     ok ($u->Id, " user exists and was created by ticket comment submission");
+    $m->no_warnings_ok;
 }
 
 diag "add comment to the ticket using '--extension action' feature";
@@ -442,6 +469,7 @@ EOF
     my $attachment = $txn->Attachments->First;
     isa_ok ($attachment, 'RT::Attachment');
     is ($attachment->GetHeader('X-RT-Mail-Extension'), 'comment', 'header is in place');
+    $m->no_warnings_ok;
 }
 
 diag "Testing preservation of binary attachments";
@@ -504,6 +532,8 @@ diag "Testing preservation of binary attachments";
 
     # Verify that the downloaded attachment is the same as what we uploaded.
     is ($file, $r->content, 'The attachment isn\'t screwed up in download');
+
+    $m->no_warnings_ok;
 }
 
 diag "Simple I18N testing";
@@ -540,6 +570,8 @@ EOF
         $tick->Transactions->First->Content =~ /$unistring/i,
         $tick->Id." appears to be unicode ". $tick->Transactions->First->Attachments->First->Id
     );
+
+    $m->no_warnings_ok;
 }
 
 diag "supposedly I18N fails on the second message sent in.";
@@ -572,6 +604,8 @@ EOF
         $tick->Transactions->First->Content =~ $unistring,
         "It appears to be unicode - ". $tick->Transactions->First->Content
     );
+
+    $m->no_warnings_ok;
 }
 
 diag "check that mailgate doesn't suffer from empty Reply-To:";
@@ -595,6 +629,8 @@ EOF
     is ($tick->Id, $id, "correct ticket");
 
     like $tick->RequestorAddresses, qr/root\@localhost/, 'correct requestor';
+
+    $m->no_warnings_ok;
 }
 
 
@@ -643,6 +679,8 @@ my $status;
 ok( $status, 'successfuly changed owner: '. ($msg||'') );
 is( $tick->Owner, $RT::Nobody->Id, 'set owner back to nobody');
 
+$m->no_warnings_ok;
+
 
 $! = 0;
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $@");
@@ -668,6 +706,9 @@ $txns->OrderBy( FIELD => 'id', ORDER => 'DESC' );
 is( $tick->Transactions->Count, 6, 'no superfluous transactions');
 is( $txns->First->Subject, "[$RT::rtname \#$id] correspondence", 'successfuly add correspond within take via email' );
 
+$m->no_warnings_ok;
+
+
 $! = 0;
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action resolve"), "Opened the mailgate - $!");
 print MAIL <<EOF;
@@ -702,6 +743,8 @@ ok( $id, 'create new ticket' );
 
 my $rtname = RT->Config->Get('rtname');
 
+$m->no_warnings_ok;
+
 $! = 0;
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take"), "Opened the mailgate - $!");
 print MAIL <<EOF;
@@ -720,6 +763,10 @@ ok( $status, "successfuly granted right: $msg" );
 my $ace_id = $status;
 ok( $user->HasRight( Right => 'ReplyToTicket', Object => $tick ), "User can reply to ticket" );
 
+$m->next_warning_like(qr/Permission Denied/);
+$m->next_warning_like(qr/Could not record email: Ticket not taken/);
+$m->no_leftover_warnings_ok;
+
 $! = 0;
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action correspond-take"), "Opened the mailgate - $!");
 print MAIL <<EOF;
@@ -735,6 +782,10 @@ DBIx::SearchBuilder::Record::Cachable->FlushCache;
 cmp_ok( $tick->Owner, '!=', $user->id, "we didn't change owner" );
 is( $tick->Transactions->Count, 3, "one transactions added" );
 
+$m->next_warning_like(qr/Permission Denied/);
+$m->next_warning_like(qr/Could not record email: Ticket not taken/);
+$m->no_leftover_warnings_ok;
+
 $! = 0;
 ok(open(MAIL, "|$RT::BinPath/rt-mailgate --url $url --queue ext-mailgate --action take-correspond"), "Opened the mailgate - $!");
 print MAIL <<EOF;
@@ -750,6 +801,10 @@ DBIx::SearchBuilder::Record::Cachable->FlushCache;
 cmp_ok( $tick->Owner, '!=', $user->id, "we didn't change owner" );
 is( $tick->Transactions->Count, 3, "no transactions added, user can't take ticket first" );
 
+$m->next_warning_like(qr/Permission Denied/);
+$m->next_warning_like(qr/Could not record email: Ticket not taken/);
+$m->no_leftover_warnings_ok;
+
 # revoke ReplyToTicket right
 use RT::ACE;
 my $ace = RT::ACE->new($RT::SystemUser);
@@ -793,6 +848,7 @@ is( $tick->Owner, $user->id, "we changed owner" );
 ok( $user->HasRight( Right => 'ReplyToTicket', Object => $tick ), "owner can reply to ticket" );
 is( $tick->Transactions->Count, 5, "transactions added" );
 
+$m->no_warnings_ok;
 
 # }}}
 };

commit 833b37f721c0d5d3a06a2bd8099615e8cfc8f705
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 27 13:48:30 2010 +0800

    add perldoc to rt scripts which miss that

diff --git a/bin/rt-crontool.in b/bin/rt-crontool.in
index b48021a..61f614d 100755
--- a/bin/rt-crontool.in
+++ b/bin/rt-crontool.in
@@ -231,13 +231,13 @@ sub process {
     print loc("Action committed.\n") if $verbose;
 }
 
-=head2 get_transactions
-
-Takes ticket and returns L<RT::Transactions> object with transactions
-of the ticket according to command line arguments C<--transaction>
-and <--transaction-type>.
-
-=cut
+# =head2 get_transactions
+# 
+# Takes ticket and returns L<RT::Transactions> object with transactions
+# of the ticket according to command line arguments C<--transaction>
+# and <--transaction-type>.
+# 
+# =cut
 
 sub get_transactions {
     my $ticket = shift;
@@ -258,11 +258,11 @@ sub get_transactions {
     return $txns;
 }
 
-=head2 get_template
-
-Takes a ticket and returns a template according to command line options.
-
-=cut
+# =head2 get_template
+# 
+# Takes a ticket and returns a template according to command line options.
+# 
+# =cut
 
 { my $cache = undef;
 sub get_template {
@@ -295,11 +295,11 @@ sub get_template {
 
 # {{{ load_module 
 
-=head2 load_module
-
-Loads a perl module, dying nicely if it can't find it.
-
-=cut
+# =head2 load_module
+# 
+# Loads a perl module, dying nicely if it can't find it.
+# 
+# =cut
 
 sub load_module {
     my $modname = shift;
@@ -314,11 +314,11 @@ sub load_module {
 
 # {{{ loc 
 
-=head2 loc LIST
-
-Localize this string, with the current user's currentuser object
-
-=cut
+# =head2 loc LIST
+# 
+# Localize this string, with the current user's currentuser object
+# 
+# =cut
 
 sub loc {
     $CurrentUser->loc(@_);
@@ -398,3 +398,90 @@ sub help {
 
     exit(0);
 }
+
+__END__
+
+=head1 NAME
+
+rt-crontool - a tool to act on tickets from an external scheduling tool
+
+=head1 SYNOPSIS
+
+    # find all active tickets in the queue 'general' and set their priority to 99 if they are overdue:
+    rt-crontool \
+      --search RT::Search::ActiveTicketsInQueue  --search-arg general \
+      --condition RT::Condition::Overdue \
+      --action RT::Action::SetPriority --action-arg 99 \
+      --verbose
+
+    # Escalate tickets
+      rt-crontool \
+        --search RT::Search::ActiveTicketsInQueue  --search-arg general \
+        --action RT::Action::EscalatePriority
+
+=head1 DESCRIPTION
+
+This script is a tool to act on tickets from an external scheduling tool, such
+as cron.
+
+Security:
+
+This tool allows the user to run arbitrary perl modules from within RT. If
+this tool were setgid, a hostile local user could use this tool to gain
+administrative access to RT. It is incredibly important that nonprivileged
+users not be allowed to run this tool. It is suggested that you create a
+non-privileged unix user with the correct group membership and RT access to
+run this tool.
+
+
+=head1 OPTIONS
+
+=over
+
+=item search 
+
+Specify the search module you want to use
+
+=item search-arg 
+
+An argument to pass to --search
+
+=item condition
+
+Specify the condition module you want to use
+
+=item condition-arg
+
+An argument to pass to --condition
+
+=item action 
+
+Specify the action module you want to use
+
+=item action-arg
+
+An argument to pass to --action
+
+=item template
+
+Specify name or id of template(s) you want to use
+
+=item transaction
+
+Specify if you want to use either 'first', 'last' or 'all' transactions
+
+
+=item transaction-type
+
+Specify the comma separated list of transactions' types you want to use
+
+=item log
+
+Adjust LogToScreen config option
+
+=item verbose
+
+Output status updates to STDOUT
+
+=back
+
diff --git a/bin/rt.in b/bin/rt.in
index e6ebe97..710b632 100755
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -51,6 +51,12 @@
 
 use strict;
 
+if ( $ARGV[0] =~ /^(?:--help|-h)$/ ) {
+    require Pod::Usage;
+    print Pod::Usage::pod2usage( { verbose => 2 } );
+    exit;
+}
+
 # This program is intentionally written to have as few non-core module
 # dependencies as possible. It should stay that way.
 
@@ -2584,3 +2590,24 @@ Text:
         $ rt shell
         rt> quit
         $
+
+__END__
+
+=head1 NAME
+
+rt - command-line interface to RT 3.0 or newer
+
+=head1 SYNOPSIS
+
+    rt help
+
+=head1 DESCRIPTION
+
+This script allows you to interact with an RT server over HTTP, and offers an
+interface to RT's functionality that is better-suited to automation and
+integration with other tools.
+
+In general, each invocation of this program should specify an action to
+perform on one or more objects, and any other arguments required to complete
+the desired action.
+
diff --git a/sbin/rt-email-digest.in b/sbin/rt-email-digest.in
index c1ad2d9..21873cc 100644
--- a/sbin/rt-email-digest.in
+++ b/sbin/rt-email-digest.in
@@ -188,13 +188,13 @@ sub send_digest {
     }
 }
 
-=item mark_transactions_sent( $frequency, $user, @txn_list );
-
-Takes a frequency string (either 'daily' or 'weekly'), a user  and one or more
-transaction objects as its arguments.  Marks the given deferred
-notifications as sent.
-
-=cut
+# =item mark_transactions_sent( $frequency, $user, @txn_list );
+# 
+# Takes a frequency string (either 'daily' or 'weekly'), a user  and one or more
+# transaction objects as its arguments.  Marks the given deferred
+# notifications as sent.
+# 
+# =cut
 
 sub mark_transactions_sent {
     my ( $freq, $user, @txns ) = @_;
@@ -335,3 +335,42 @@ sub build_digest_for_user {
     return ( $contents_list, $contents_body );
 
 }
+
+__END__
+
+=head1 NAME
+
+rt-email-digest - dispatch deferred notifications as a per-user digest
+
+=head1 SYNOPSIS
+
+    rt-email-digest -m (daily|weekly) [--print] [--help]
+
+=head1 DESCRIPTION
+
+This script is a tool to dispatch all deferred RT notifications as a per-user
+object.
+
+=head1 OPTIONS
+
+=over
+
+=item mode
+
+Specify whether this is a daily or weekly run.
+
+--mode is equal to -m
+
+=item print
+
+Print the resulting digest messages to STDOUT; don't mail them. Do not mark them as sent
+
+--print is equal to -p
+
+=item help
+
+Print this message
+
+--help is equal to -h
+
+=back

commit 0963103f2319898ea5f13922de32de44056d6dee
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Wed Aug 25 16:52:51 2010 +0800

    rework the test init sequence to allow nodb, noinitialdata, and nodata options from tests.

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 448e5d0..72c6d94 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -152,10 +152,14 @@ sub import {
 
     $class->bootstrap_db( %args );
 
-    RT->Init;
+    RT->InitClasses();
+    RT->InitLogging();
 
     $class->bootstrap_plugins( %args );
 
+    RT->InitPlugins();
+    RT->Config->PostLoadCheck;
+
     $class->set_config_wrapper;
 
     my $screen_logger = $RT::Logger->remove( 'screen' );
@@ -348,39 +352,48 @@ sub bootstrap_db {
         RT::Handle->DropDatabase( $dbh, Force => 1 );
     }
 
-    RT::Handle->CreateDatabase( $dbh );
-    $dbh->disconnect;
-    $created_new_db++;
+    if ($args{nodb}) {
+        $args{noinitialdata} = 1;
+        $args{nodata} = 1;
+    }
 
-    $dbh = _get_dbh(RT::Handle->DSN,
-            $ENV{RT_DBA_USER}, $ENV{RT_DBA_PASSWORD});
+    unless ($args{nodb}) {
+        RT::Handle->CreateDatabase( $dbh );
+        $dbh->disconnect;
+        $created_new_db++;
 
-    $RT::Handle = RT::Handle->new;
-    $RT::Handle->dbh( $dbh );
-    $RT::Handle->InsertSchema( $dbh );
+        $dbh = _get_dbh(RT::Handle->DSN,
+                        $ENV{RT_DBA_USER}, $ENV{RT_DBA_PASSWORD});
 
-    my $db_type = RT->Config->Get('DatabaseType');
-    $RT::Handle->InsertACL( $dbh ) unless $db_type eq 'Oracle';
+        $RT::Handle = RT::Handle->new;
+        $RT::Handle->dbh( $dbh );
+        $RT::Handle->InsertSchema( $dbh );
 
-    $RT::Handle = RT::Handle->new;
-    $RT::Handle->dbh( undef );
-    RT->ConnectToDatabase;
-    RT->InitLogging;
-    RT->InitSystemObjects;
-    $RT::Handle->InsertInitialData;
+        my $db_type = RT->Config->Get('DatabaseType');
+        $RT::Handle->InsertACL( $dbh ) unless $db_type eq 'Oracle';
 
-    DBIx::SearchBuilder::Record::Cachable->FlushCache;
-    $RT::Handle = RT::Handle->new;
-    $RT::Handle->dbh( undef );
-    RT->Init;
+        $RT::Handle = RT::Handle->new;
+        $RT::Handle->dbh( undef );
+        RT->ConnectToDatabase;
+        RT->InitLogging;
+
+        unless ($args{noinitialdata}) {
+            $RT::Handle->InsertInitialData;
 
-    $RT::Handle->PrintError;
-    $RT::Handle->dbh->{PrintError} = 1;
+            DBIx::SearchBuilder::Record::Cachable->FlushCache;
+        }
+
+        $RT::Handle = RT::Handle->new;
+        $RT::Handle->dbh( undef );
+        RT->ConnectToDatabase();
+        $RT::Handle->PrintError;
+        $RT::Handle->dbh->{PrintError} = 1;
 
-    unless ( $args{'nodata'} ) {
-        $RT::Handle->InsertData( $RT::EtcPath . "/initialdata" );
+        unless ( $args{'nodata'} ) {
+            $RT::Handle->InsertData( $RT::EtcPath . "/initialdata" );
+            DBIx::SearchBuilder::Record::Cachable->FlushCache;
+        }
     }
-    DBIx::SearchBuilder::Record::Cachable->FlushCache;
 }
 
 sub bootstrap_plugins {
diff --git a/t/00-compile.t b/t/00-compile.t
index 1baf74c..6718a11 100644
--- a/t/00-compile.t
+++ b/t/00-compile.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 31;
+use RT::Test nodb => 1, tests => 31;
 
 require_ok("RT");
 require_ok("RT::Test");
diff --git a/t/00-mason-syntax.t b/t/00-mason-syntax.t
index a451805..9e29acd 100644
--- a/t/00-mason-syntax.t
+++ b/t/00-mason-syntax.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 1;
+use RT::Test nodb => 1, tests => 1;
 
 my $ok = 1;
 
diff --git a/t/api/i18n.t b/t/api/i18n.t
index dcfe050..831532b 100644
--- a/t/api/i18n.t
+++ b/t/api/i18n.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 9;
+use RT::Test nodb => 1, tests => 9;
 
 
 {
diff --git a/t/api/queue.t b/t/api/queue.t
index 97e06b2..cc2af81 100644
--- a/t/api/queue.t
+++ b/t/api/queue.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 24;
+use RT::Test nodata => 1, tests => 24;
 
 
 {
diff --git a/t/mail/mime_decoding.t b/t/mail/mime_decoding.t
index b0093c5..e5449ef 100644
--- a/t/mail/mime_decoding.t
+++ b/t/mail/mime_decoding.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use RT::Test nodata => 1, tests => 7;
+use RT::Test nodb => 1, tests => 7;
 
 use_ok('RT::I18N');
 
diff --git a/t/mail/wrong_mime_charset.t b/t/mail/wrong_mime_charset.t
index f53c872..b0079f8 100644
--- a/t/mail/wrong_mime_charset.t
+++ b/t/mail/wrong_mime_charset.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use RT::Test nodata => 1, tests => 3;
+use RT::Test nodb => 1, tests => 3;
 
 use_ok('RT::I18N');
 use utf8;

commit bc36a06fd8e558c012991e4881d39718bef30ff6
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Wed Aug 25 20:45:53 2010 +0800

    avoid creating db or inserting initialdata for tests that don't need them

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 72c6d94..bcee9fc 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -352,10 +352,18 @@ sub bootstrap_db {
         RT::Handle->DropDatabase( $dbh, Force => 1 );
     }
 
+    if (my $forceopt = $ENV{RT_TEST_FORCE_OPT}) {
+        Test::More::diag "forcing $forceopt";
+        $args{$forceopt}=1;
+    }
+
     if ($args{nodb}) {
         $args{noinitialdata} = 1;
         $args{nodata} = 1;
     }
+    elsif ($args{noinitialdata}) {
+        $args{nodata} = 1;
+    }
 
     unless ($args{nodb}) {
         RT::Handle->CreateDatabase( $dbh );
diff --git a/t/api/ace.t b/t/api/ace.t
index cb3e342..45aed33 100644
--- a/t/api/ace.t
+++ b/t/api/ace.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 76;
+use RT::Test nodata => 1, tests => 76;
 
 
 {
diff --git a/t/api/attachment.t b/t/api/attachment.t
index f6732e9..f10771a 100644
--- a/t/api/attachment.t
+++ b/t/api/attachment.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 4;
+use RT::Test nodb => 1, tests => 4;
 
 
 {
diff --git a/t/api/attribute-tests.t b/t/api/attribute-tests.t
index 747d1eb..a1e2114 100644
--- a/t/api/attribute-tests.t
+++ b/t/api/attribute-tests.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 34;
+use RT::Test nodata => 1, tests => 34;
 
 
 
diff --git a/t/api/attribute.t b/t/api/attribute.t
index bbd96da..481c4ed 100644
--- a/t/api/attribute.t
+++ b/t/api/attribute.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 7;
+use RT::Test nodata => 1, tests => 7;
 
 
 {
diff --git a/t/api/cf.t b/t/api/cf.t
index 98114c9..b82643e 100644
--- a/t/api/cf.t
+++ b/t/api/cf.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings FATAL => 'all';
 
-use RT::Test tests => 139;
+use RT::Test nodata => 1, tests => 139;
 
 # Before we get going, ditch all object_cfs; this will remove 
 # all custom fields systemwide;
diff --git a/t/api/cf_combo_cascade.t b/t/api/cf_combo_cascade.t
index 52fa54a..3dde532 100644
--- a/t/api/cf_combo_cascade.t
+++ b/t/api/cf_combo_cascade.t
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 11;
+use RT::Test nodata => 1, tests => 11;
 
 sub fails { ok(!$_[0], "This should fail: $_[1]") }
 sub works { ok($_[0], $_[1] || 'This works') }
diff --git a/t/api/cf_date_search.t b/t/api/cf_date_search.t
index 15abd70..aea2925 100644
--- a/t/api/cf_date_search.t
+++ b/t/api/cf_date_search.t
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 13;
+use RT::Test nodata => 1, tests => 13;
 
 my $q = RT::Queue->new($RT::SystemUser);
 ok( $q->Create( Name => 'DateCFTest' . $$ ), 'create queue' );
diff --git a/t/api/cf_datetime_search.t b/t/api/cf_datetime_search.t
index d0884f4..44582e1 100644
--- a/t/api/cf_datetime_search.t
+++ b/t/api/cf_datetime_search.t
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 14;
+use RT::Test nodata => 1, tests => 14;
 RT->Config->Set( 'Timezone' => 'EST5EDT' ); # -04:00
 
 my $q = RT::Queue->new($RT::SystemUser);
diff --git a/t/api/cf_pattern.t b/t/api/cf_pattern.t
index ffc5b3f..cf791bc 100644
--- a/t/api/cf_pattern.t
+++ b/t/api/cf_pattern.t
@@ -3,7 +3,7 @@ use warnings;
 use strict;
 
 use RT;
-use RT::Test tests => 17;
+use RT::Test nodata => 1, tests => 17;
 
 
 sub fails { ok(!$_[0], "This should fail: $_[1]") }
diff --git a/t/api/cf_single_values.t b/t/api/cf_single_values.t
index 24e8ef4..bc2db1e 100644
--- a/t/api/cf_single_values.t
+++ b/t/api/cf_single_values.t
@@ -3,7 +3,7 @@ use warnings;
 use strict;
 
 use RT;
-use RT::Test tests => 8;
+use RT::Test nodata => 1, tests => 8;
 
 
 
diff --git a/t/api/cf_transaction.t b/t/api/cf_transaction.t
index 1ed2ab9..589151f 100644
--- a/t/api/cf_transaction.t
+++ b/t/api/cf_transaction.t
@@ -4,7 +4,7 @@ use warnings;
 use strict;
 use Data::Dumper;
 
-use RT::Test tests => 14;
+use RT::Test nodata => 1, tests => 14;
 use_ok('RT');
 use_ok('RT::Transactions');
 
diff --git a/t/api/config.t b/t/api/config.t
index 8e24be0..a986c3c 100644
--- a/t/api/config.t
+++ b/t/api/config.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 9;
+use RT::Test nodb => 1, tests => 9;
 
 ok(
     RT::Config->AddOption(
diff --git a/t/api/currentuser.t b/t/api/currentuser.t
index cd3e776..f54074a 100644
--- a/t/api/currentuser.t
+++ b/t/api/currentuser.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 8;
+use RT::Test noinitialdata => 1, tests => 8;
 
 
 {
diff --git a/t/api/customfield.t b/t/api/customfield.t
index 41d35ef..131c941 100644
--- a/t/api/customfield.t
+++ b/t/api/customfield.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 29;
+use RT::Test nodata => 1, tests => 29;
 use Test::Warn;
 
 
diff --git a/t/api/emailparser.t b/t/api/emailparser.t
index 00c2a82..6861f8d 100644
--- a/t/api/emailparser.t
+++ b/t/api/emailparser.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 4;
+use RT::Test nodb => 1, tests => 4;
 
 RT->Config->Set( RTAddressRegexp => qr/^rt\@example.com$/i );
 
diff --git a/t/api/group.t b/t/api/group.t
index 1e4fb38..a03f3d5 100644
--- a/t/api/group.t
+++ b/t/api/group.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 38;
+use RT::Test nodata => 1, tests => 38;
 
 
 {
diff --git a/t/api/groups.t b/t/api/groups.t
index e0c398a..f97e99c 100644
--- a/t/api/groups.t
+++ b/t/api/groups.t
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use RT::Test tests => 27;
+use RT::Test nodata => 1, tests => 27;
 
 RT::Group->AddRights(
     'RTxGroupRight' => 'Just a right for testing rights',
diff --git a/t/api/link.t b/t/api/link.t
index 47a839f..15bd2ee 100644
--- a/t/api/link.t
+++ b/t/api/link.t
@@ -2,8 +2,8 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 83;
-use RT::Test::Web;
+use RT::Test nodata => 1, tests => 83;
+use RT::Test nodata => 1, tests => 83;
 
 use RT::Link;
 my $link = RT::Link->new($RT::SystemUser);
diff --git a/t/api/rights.t b/t/api/rights.t
index a38bcea..b9f742a 100644
--- a/t/api/rights.t
+++ b/t/api/rights.t
@@ -47,7 +47,7 @@
 # 
 # END BPS TAGGED BLOCK }}}
 
-use RT::Test tests => 30;
+use RT::Test nodata => 1, tests => 30;
 
 use strict;
 use warnings;
diff --git a/t/api/rights_show_ticket.t b/t/api/rights_show_ticket.t
index 3e1d074..4d4474e 100644
--- a/t/api/rights_show_ticket.t
+++ b/t/api/rights_show_ticket.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-use RT::Test tests => 264;
+use RT::Test nodata => 1, tests => 264;
 
 use strict;
 use warnings;
diff --git a/t/api/rt.t b/t/api/rt.t
index 8c8762c..4582937 100644
--- a/t/api/rt.t
+++ b/t/api/rt.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 4;
+use RT::Test nodata => 1, tests => 4;
 
 
 {
diff --git a/t/api/system.t b/t/api/system.t
index 318705a..876109f 100644
--- a/t/api/system.t
+++ b/t/api/system.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 7;
+use RT::Test nodata => 1, tests => 7;
 
 
 {
diff --git a/t/clicky.t b/t/clicky.t
index 9baa2af..0f16db6 100644
--- a/t/clicky.t
+++ b/t/clicky.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use RT::Test tests => 14;
+use RT::Test nodb => 1, tests => 14;
 my %clicky;
 
 BEGIN {
diff --git a/t/cron.t b/t/cron.t
index b8fa0df..2d20617 100644
--- a/t/cron.t
+++ b/t/cron.t
@@ -3,7 +3,7 @@
 use strict;
 
 use RT;
-use RT::Test tests => 18;
+use RT::Test nodata => 1, tests => 18;
 
 
 ### Set up some testing data.  Test the testing data because why not?
diff --git a/t/customfields/access_via_queue.t b/t/customfields/access_via_queue.t
index f372f31..2c442bf 100644
--- a/t/customfields/access_via_queue.t
+++ b/t/customfields/access_via_queue.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 35;
+use RT::Test nodata => 1, tests => 35;
 use RT::Ticket;
 use RT::CustomField;
 
diff --git a/t/delegation/cleanup_stalled.t b/t/delegation/cleanup_stalled.t
index f108ecc..750576d 100644
--- a/t/delegation/cleanup_stalled.t
+++ b/t/delegation/cleanup_stalled.t
@@ -15,7 +15,7 @@ use warnings;
 
 use RT;
 
-use RT::Test tests => 98;
+use RT::Test nodata => 1, tests => 98;
 
 my ($u1, $u2, $g1, $g2, $g3, $pg1, $pg2, $ace, @groups, @users, @principals);
 @groups = (\$g1, \$g2, \$g3, \$pg1, \$pg2);
diff --git a/t/delegation/revocation.t b/t/delegation/revocation.t
index 151525e..2cde33c 100644
--- a/t/delegation/revocation.t
+++ b/t/delegation/revocation.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT;
 
-use RT::Test tests => 22;
+use RT::Test nodata => 1, tests => 22;
 
 my ($u1, $g1, $pg1, $pg2, $ace, @groups, @users, @principals);
 @groups = (\$g1, \$pg1, \$pg2);
diff --git a/t/i18n/default.t b/t/i18n/default.t
index 6c9842a..d580f97 100644
--- a/t/i18n/default.t
+++ b/t/i18n/default.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 8;
+use RT::Test nodb => 1, tests => 8;
 
 my ($baseurl, $m) = RT::Test->started_ok;
 $m->get_ok('/');
diff --git a/t/mail/verp.t b/t/mail/verp.t
index 79ede90..ed3af6a 100644
--- a/t/mail/verp.t
+++ b/t/mail/verp.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use RT::Test tests => 1;
+use RT::Test nodb => 1, tests => 1;
 TODO: { 
     todo_skip "No tests written for VERP yet", 1;
     ok(1,"a test to skip");
diff --git a/t/shredder/00load.t b/t/shredder/00load.t
index 1e06261..21d5ef7 100644
--- a/t/shredder/00load.t
+++ b/t/shredder/00load.t
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 use File::Spec;
 use Test::More tests => 11;
-use RT::Test ();
+use RT::Test nodb => 1;
 
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
diff --git a/t/shredder/00skeleton.t b/t/shredder/00skeleton.t
index eab9433..3592429 100644
--- a/t/shredder/00skeleton.t
+++ b/t/shredder/00skeleton.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 1;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/01basics.t b/t/shredder/01basics.t
index 450f2df..069b96f 100644
--- a/t/shredder/01basics.t
+++ b/t/shredder/01basics.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 3;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/01ticket.t b/t/shredder/01ticket.t
index 5625b98..8052e7c 100644
--- a/t/shredder/01ticket.t
+++ b/t/shredder/01ticket.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 15;
-use RT::Test ();
+use RT::Test nodb => 1;
 
 
 BEGIN {
diff --git a/t/shredder/02group_member.t b/t/shredder/02group_member.t
index c391f74..d6815f4 100644
--- a/t/shredder/02group_member.t
+++ b/t/shredder/02group_member.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 22;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02queue.t b/t/shredder/02queue.t
index 8e3abf3..ab7d541 100644
--- a/t/shredder/02queue.t
+++ b/t/shredder/02queue.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 16;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02template.t b/t/shredder/02template.t
index 14bda86..769a858 100644
--- a/t/shredder/02template.t
+++ b/t/shredder/02template.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 7;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02user.t b/t/shredder/02user.t
index 03abd6c..4745e2d 100644
--- a/t/shredder/02user.t
+++ b/t/shredder/02user.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 8;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin.t b/t/shredder/03plugin.t
index cf51e44..25b1222 100644
--- a/t/shredder/03plugin.t
+++ b/t/shredder/03plugin.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 28;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin_summary.t b/t/shredder/03plugin_summary.t
index 606cd67..2744531 100644
--- a/t/shredder/03plugin_summary.t
+++ b/t/shredder/03plugin_summary.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 4;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin_tickets.t b/t/shredder/03plugin_tickets.t
index 57ab0af..08bb15b 100644
--- a/t/shredder/03plugin_tickets.t
+++ b/t/shredder/03plugin_tickets.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 44;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin_users.t b/t/shredder/03plugin_users.t
index e49dd7b..4f4ecc8 100644
--- a/t/shredder/03plugin_users.t
+++ b/t/shredder/03plugin_users.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 9;
-use RT::Test ();
+use RT::Test nodb => 1;
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/ticket/add-watchers.t b/t/ticket/add-watchers.t
index ae993a9..19b1fcb 100644
--- a/t/ticket/add-watchers.t
+++ b/t/ticket/add-watchers.t
@@ -45,7 +45,7 @@
 # 
 # END BPS TAGGED BLOCK }}}
 
-use RT::Test tests => 32;
+use RT::Test nodata => 1, tests => 32;
 
 use strict;
 use warnings;
diff --git a/t/ticket/cfsort-freeform-multiple.t b/t/ticket/cfsort-freeform-multiple.t
index b5fd93b..b7bcc0a 100644
--- a/t/ticket/cfsort-freeform-multiple.t
+++ b/t/ticket/cfsort-freeform-multiple.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use RT::Test tests => 24;
+use RT::Test nodata => 1, tests => 24;
 
 use strict;
 use warnings;
diff --git a/t/ticket/cfsort-freeform-single.t b/t/ticket/cfsort-freeform-single.t
index 4bf3300..bae7707 100644
--- a/t/ticket/cfsort-freeform-single.t
+++ b/t/ticket/cfsort-freeform-single.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use RT::Test tests => 57;
+use RT::Test nodata => 1, tests => 57;
 
 use strict;
 use warnings;
diff --git a/t/ticket/deferred_owner.t b/t/ticket/deferred_owner.t
index 917bbcd..4b9cb02 100644
--- a/t/ticket/deferred_owner.t
+++ b/t/ticket/deferred_owner.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 18;
+use RT::Test nodata => 1, tests => 18;
 use_ok('RT');
 use_ok('RT::Ticket');
 use Test::Warn;
diff --git a/t/ticket/search.t b/t/ticket/search.t
index 9cec4f7..849ce46 100644
--- a/t/ticket/search.t
+++ b/t/ticket/search.t
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 43;
+use RT::Test nodata => 1, tests => 43;
 
 # setup the queue
 
diff --git a/t/ticket/search_by_cf_freeform_multiple.t b/t/ticket/search_by_cf_freeform_multiple.t
index 8793a7c..0499a31 100644
--- a/t/ticket/search_by_cf_freeform_multiple.t
+++ b/t/ticket/search_by_cf_freeform_multiple.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 105;
+use RT::Test nodata => 1, tests => 105;
 use RT::Ticket;
 
 my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
diff --git a/t/ticket/search_by_cf_freeform_single.t b/t/ticket/search_by_cf_freeform_single.t
index f597071..4fe598c 100644
--- a/t/ticket/search_by_cf_freeform_single.t
+++ b/t/ticket/search_by_cf_freeform_single.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 99;
+use RT::Test nodata => 1, tests => 99;
 use RT::Ticket;
 
 my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
diff --git a/t/ticket/search_by_links.t b/t/ticket/search_by_links.t
index 611c158..462a766 100644
--- a/t/ticket/search_by_links.t
+++ b/t/ticket/search_by_links.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 80;
+use RT::Test nodata => 1, tests => 80;
 use RT::Ticket;
 
 my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
diff --git a/t/ticket/search_by_watcher.t b/t/ticket/search_by_watcher.t
index b3a16db..57c3a46 100644
--- a/t/ticket/search_by_watcher.t
+++ b/t/ticket/search_by_watcher.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 119;
+use RT::Test nodata => 1, tests => 119;
 use RT::Ticket;
 
 my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
diff --git a/t/ticket/search_long_cf_values.t b/t/ticket/search_long_cf_values.t
index f9cc7b5..339ad70 100644
--- a/t/ticket/search_long_cf_values.t
+++ b/t/ticket/search_long_cf_values.t
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 10;
+use RT::Test nodata => 1, tests => 10;
 
 # setup the queue
 
diff --git a/t/ticket/sort-by-custom-ownership.t b/t/ticket/sort-by-custom-ownership.t
index b358a99..3e5df64 100644
--- a/t/ticket/sort-by-custom-ownership.t
+++ b/t/ticket/sort-by-custom-ownership.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use RT;
-use RT::Test tests => 7;
+use RT::Test nodata => 1, tests => 7;
 
 
 use strict;
diff --git a/t/ticket/sort-by-queue.t b/t/ticket/sort-by-queue.t
index 8f89bd3..881a59d 100644
--- a/t/ticket/sort-by-queue.t
+++ b/t/ticket/sort-by-queue.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use RT::Test tests => 8;
+use RT::Test nodata => 1, tests => 8;
 
 use strict;
 use warnings;
diff --git a/t/ticket/sort-by-user.t b/t/ticket/sort-by-user.t
index d1aae1a..b5f6552 100644
--- a/t/ticket/sort-by-user.t
+++ b/t/ticket/sort-by-user.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use RT::Test tests => 32;
+use RT::Test nodata => 1, tests => 32;
 
 use strict;
 use warnings;
diff --git a/t/ticket/sort_by_cf.t b/t/ticket/sort_by_cf.t
index 7e25884..8999942 100644
--- a/t/ticket/sort_by_cf.t
+++ b/t/ticket/sort_by_cf.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use RT::Test tests => 21;
+use RT::Test nodata => 1, tests => 21;
 RT::Init();
 
 use strict;
diff --git a/t/web/config_tab_right.t b/t/web/config_tab_right.t
index 4dc9ec0..d7f4cbf 100644
--- a/t/web/config_tab_right.t
+++ b/t/web/config_tab_right.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 8;
+use RT::Test nodata => 1, tests => 8;
 
 my ($uname, $upass, $user) = ('tester', 'tester');
 {
diff --git a/t/web/dashboards-groups.t b/t/web/dashboards-groups.t
index cbf1d6a..6b39d01 100644
--- a/t/web/dashboards-groups.t
+++ b/t/web/dashboards-groups.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 40;
+use RT::Test nodata => 1, tests => 40;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 my $url = $m->rt_base_url;
diff --git a/t/web/dashboards-permissions.t b/t/web/dashboards-permissions.t
index 1724042..8dc7532 100644
--- a/t/web/dashboards-permissions.t
+++ b/t/web/dashboards-permissions.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 7;
+use RT::Test nodata => 1, tests => 7;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 my $url = $m->rt_base_url;
diff --git a/t/web/rights1.t b/t/web/rights1.t
index 0b00c27..059b0b4 100644
--- a/t/web/rights1.t
+++ b/t/web/rights1.t
@@ -2,7 +2,7 @@
 use strict;
 use HTTP::Cookies;
 
-use RT::Test tests => 29;
+use RT::Test nodata => 1, tests => 29;
 my ($baseurl, $agent) = RT::Test->started_ok;
 
 # Create a user with basically no rights, to start.
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index 0460436..d018ec1 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 89;
+use RT::Test nodata => 1, tests => 89;
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
 ok $queue && $queue->id, 'loaded or created queue';
diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 9263a75..07f90f2 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 41;
+use RT::Test nodata => 1, tests => 41;
 use JSON qw(from_json);
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
diff --git a/t/web/ticket_seen.t b/t/web/ticket_seen.t
index 748f2cb..a285c6a 100644
--- a/t/web/ticket_seen.t
+++ b/t/web/ticket_seen.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 21;
+use RT::Test nodata => 1, tests => 21;
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
 ok $queue && $queue->id, 'loaded or created queue';

commit c42967a54d2b548357216f999d201b98697d52ca
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Thu Aug 26 10:28:35 2010 +0800

    pg really wants reconnecting to db

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index bcee9fc..e84434a 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -152,12 +152,17 @@ sub import {
 
     $class->bootstrap_db( %args );
 
-    RT->InitClasses();
-    RT->InitLogging();
+    RT::InitPluginPaths();
+
+    RT::ConnectToDatabase()
+        unless $args{nodb};
+
+    RT::InitClasses();
+    RT::InitLogging();
 
     $class->bootstrap_plugins( %args );
 
-    RT->InitPlugins();
+    RT::InitPlugins();
     RT->Config->PostLoadCheck;
 
     $class->set_config_wrapper;
@@ -437,7 +442,6 @@ sub bootstrap_plugins {
     };
 
     RT->Config->Set( Plugins => @plugins );
-    RT->InitPluginPaths;
 
     my $dba_dbh;
     $dba_dbh = _get_dbh(

commit 33456b17d3a375f31e73d0cae51e37f6e12d190c
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Thu Aug 26 10:49:47 2010 +0800

    Fix test planning

diff --git a/t/api/link.t b/t/api/link.t
index 15bd2ee..ffb96d9 100644
--- a/t/api/link.t
+++ b/t/api/link.t
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use RT::Test nodata => 1, tests => 83;
-use RT::Test nodata => 1, tests => 83;
+use RT::Test::Web;
 
 use RT::Link;
 my $link = RT::Link->new($RT::SystemUser);

commit 53c97fa231591b6c0b2ebea7bf9e9614c749771b
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Thu Aug 26 11:28:52 2010 +0800

    Don't drop db on nodb

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index e84434a..07e0aa3 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -352,11 +352,6 @@ sub bootstrap_db {
     my $dbh = _get_dbh(RT::Handle->SystemDSN,
                $ENV{RT_DBA_USER}, $ENV{RT_DBA_PASSWORD});
 
-    unless ( $ENV{RT_TEST_PARALLEL} ) {
-        # already dropped db in parallel tests, need to do so for other cases.
-        RT::Handle->DropDatabase( $dbh, Force => 1 );
-    }
-
     if (my $forceopt = $ENV{RT_TEST_FORCE_OPT}) {
         Test::More::diag "forcing $forceopt";
         $args{$forceopt}=1;
@@ -371,6 +366,10 @@ sub bootstrap_db {
     }
 
     unless ($args{nodb}) {
+        unless ( $ENV{RT_TEST_PARALLEL} ) {
+            # already dropped db in parallel tests, need to do so for other cases.
+            RT::Handle->DropDatabase( $dbh, Force => 1 )
+        }
         RT::Handle->CreateDatabase( $dbh );
         $dbh->disconnect;
         $created_new_db++;

commit 679ebad764d4a157edbb9fdfa9fe773d4a401836
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Fri Aug 27 15:34:38 2010 +0800

    web tests require db to exist

diff --git a/t/clicky.t b/t/clicky.t
index 0f16db6..b72ae9b 100644
--- a/t/clicky.t
+++ b/t/clicky.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use RT::Test nodb => 1, tests => 14;
+use RT::Test noinitialdata => 1, tests => 14;
 my %clicky;
 
 BEGIN {
diff --git a/t/i18n/default.t b/t/i18n/default.t
index d580f97..cc6f136 100644
--- a/t/i18n/default.t
+++ b/t/i18n/default.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodb => 1, tests => 8;
+use RT::Test noinitialdata => 1, tests => 8;
 
 my ($baseurl, $m) = RT::Test->started_ok;
 $m->get_ok('/');

commit bd16e7899800b095d7f2783f5d8b4001ea576087
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Fri Aug 27 15:34:56 2010 +0800

    warn about test server and nodb flag

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 07e0aa3..1b7f846 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -88,6 +88,8 @@ my %tmp = (
     mailbox   => undef,
 );
 
+my %rttest_opt;
+
 =head1 NAME
 
 RT::Test - RT Testing
@@ -130,7 +132,7 @@ BEGIN {
 
 sub import {
     my $class = shift;
-    my %args = @_;
+    my %args = %rttest_opt = @_;
 
     # Spit out a plan (if we got one) *before* we load modules
     if ( $args{'tests'} ) {
@@ -1077,6 +1079,10 @@ sub started_ok {
 
     require RT::Test::Web;
 
+    if ($rttest_opt{nodb}) {
+        die "you are trying to use a test web server without db, try use noinitialdata => 1 instead";
+    }
+
     my $which = $ENV{'RT_TEST_WEB_HANDLER'} || 'standalone';
     my ($server, $variant) = split /\+/, $which, 2;
 

commit 194fb2795c4b9c8fdb02dc4b9e3080cef27bc249
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Fri Aug 27 23:32:12 2010 +0800

    make shredder tests work again

diff --git a/t/shredder/00skeleton.t b/t/shredder/00skeleton.t
index 3592429..eab9433 100644
--- a/t/shredder/00skeleton.t
+++ b/t/shredder/00skeleton.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 1;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/01basics.t b/t/shredder/01basics.t
index 069b96f..450f2df 100644
--- a/t/shredder/01basics.t
+++ b/t/shredder/01basics.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 3;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/01ticket.t b/t/shredder/01ticket.t
index 8052e7c..5625b98 100644
--- a/t/shredder/01ticket.t
+++ b/t/shredder/01ticket.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 15;
-use RT::Test nodb => 1;
+use RT::Test ();
 
 
 BEGIN {
diff --git a/t/shredder/02group_member.t b/t/shredder/02group_member.t
index d6815f4..c391f74 100644
--- a/t/shredder/02group_member.t
+++ b/t/shredder/02group_member.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 22;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02queue.t b/t/shredder/02queue.t
index ab7d541..8e3abf3 100644
--- a/t/shredder/02queue.t
+++ b/t/shredder/02queue.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 16;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02template.t b/t/shredder/02template.t
index 769a858..14bda86 100644
--- a/t/shredder/02template.t
+++ b/t/shredder/02template.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 7;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/02user.t b/t/shredder/02user.t
index 4745e2d..03abd6c 100644
--- a/t/shredder/02user.t
+++ b/t/shredder/02user.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 8;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin.t b/t/shredder/03plugin.t
index 25b1222..cf51e44 100644
--- a/t/shredder/03plugin.t
+++ b/t/shredder/03plugin.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 28;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());
diff --git a/t/shredder/03plugin_tickets.t b/t/shredder/03plugin_tickets.t
index 08bb15b..57ab0af 100644
--- a/t/shredder/03plugin_tickets.t
+++ b/t/shredder/03plugin_tickets.t
@@ -6,7 +6,7 @@ use warnings;
 use Test::Deep;
 use File::Spec;
 use Test::More tests => 44;
-use RT::Test nodb => 1;
+use RT::Test ();
 BEGIN {
     my $shredder_utils = RT::Test::get_relocatable_file('utils.pl',
         File::Spec->curdir());

commit a4376680a4bd53c87aee7895d3c599c7731215ff
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri Aug 27 14:49:21 2010 -0400

    If there's bad data in RT's links table, use a generic URI parser rather
    than explode

diff --git a/lib/RT/URI.pm b/lib/RT/URI.pm
index 59e8df2..eaf4698 100755
--- a/lib/RT/URI.pm
+++ b/lib/RT/URI.pm
@@ -136,6 +136,7 @@ sub FromURI {
 	$scheme = $1;
     }
     else {
+        $self->{resolver} = RT::URI::base->new( $self->CurrentUser ); # clear resolver
         $RT::Logger->warning("Could not determine a URI scheme for $uri");
         return (undef);
     }

commit adc33c741553b09aba5619de76db9fa8c461d10e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Aug 30 11:30:42 2010 +0800

    people may want multiple toggle-bookmark elements in one page, e.g. adding bottom tabs

diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index cb905c1..42e67b6 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -81,9 +81,9 @@ if ( $Toggle ) {
 $id
 $Toggle => 0
 </%ARGS>
-<span id="toggle-bookmark-<% $id %>">
+<span class="toggle-bookmark-<% $id %>">
 % my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id;
-<a align="right" href="<% $url %>" onclick="jQuery('#toggle-bookmark-<% $id |n%>').load('<% $url |n %>'); return false;" >
+<a align="right" href="<% $url %>" onclick="jQuery('.toggle-bookmark-<% $id |n%>').load('<% $url |n %>'); return false;" >
 % if ( $bookmarked ) {
 <img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/star.gif" alt="<% loc('Remove Bookmark') %>" style="border-style: none" />
 % } else {

commit f3c1636453f992364ebec21038010c7368b56a6e
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date:   Mon Aug 30 17:54:26 2010 +0200

    Avoid code duplication and ease change of title in ticket display page

diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index b7f2eda..0e6d761 100755
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -46,12 +46,12 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <& /Elements/Header, 
-    Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject),
+    Title => $title,
     LinkRel => \%link_rel &>
 <& /Ticket/Elements/Tabs, 
     Ticket => $TicketObj, 
     current_tab => 'Ticket/Display.html?id='.$TicketObj->id,
-    Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &>
+    Title => $title &>
 
 % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@Actions, ARGSRef => \%ARGS, Ticket => $TicketObj);
 
@@ -100,7 +100,7 @@ $Collapsed => undef
 
 $m->callback( TicketObj => $TicketObj, ARGSRef => \%ARGS, CallbackName => 'Initial' );
 
-my (@Actions, $Tickets);  
+my (@Actions, $Tickets, $title);
 
 
 unless ($id || $TicketObj) {
@@ -177,11 +177,14 @@ if ($ARGS{'id'} eq 'new') {
     }
 }
 
+$title = loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject);
+
 $m->callback(
     CallbackName => 'BeforeDisplay',
     TicketObj => \$TicketObj,
     Tickets => \$Tickets,
     Actions => \@Actions,
+    title => \$title,
     ARGSRef => \%ARGS,
 );
 

commit d6bfbe848711931b3663697401d0adaa7cbcaf20
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 14:10:10 2010 -0400

    make the ticket creation helper not do extra homepage loads. saves 10%
    on RT's longest testfile t/web/gnupg-outgoing.t

diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index feff736..5761f7c 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -152,10 +152,7 @@ sub goto_create_ticket {
         die "not yet implemented";
     }
 
-    $self->get('/');
-    $self->form_name('CreateTicketInQueue');
-    $self->select( 'Queue', $id );
-    $self->submit;
+    $self->get($self->rt_base_url . '/Ticket/Create.html?Queue='.$id);
 
     return 1;
 }

commit c7e8cfd5bdf7cf2eed16b089f4639ea38be3b386
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 14:10:46 2010 -0400

    localize a variable in Create.html

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 6932bd8..098f1b8 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -274,9 +274,8 @@ $m->callback( CallbackName => "Init", ARGSRef => \%ARGS );
 my $Queue = $ARGS{Queue};
 $session{DefaultQueue} = $Queue;
 
-my $CloneTicketObj;
 if ($CloneTicket) {
-    $CloneTicketObj = RT::Ticket->new( $session{CurrentUser} );
+    my $CloneTicketObj = RT::Ticket->new( $session{CurrentUser} );
     $CloneTicketObj->Load($CloneTicket)
         or Abort( loc("Ticket could not be loaded") );
 

commit 1018f2e035e81db4748bbc5a2422b2630a61108d
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 14:39:42 2010 -0400

    When t/web/gnupg_outgoing.t does a reply, avoid a full ticket page load.

diff --git a/t/web/gnupg-outgoing.t b/t/web/gnupg-outgoing.t
index b4a741a..9eb56f4 100644
--- a/t/web/gnupg-outgoing.t
+++ b/t/web/gnupg-outgoing.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 492;
+use RT::Test tests => 456;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -94,8 +94,7 @@ diag "check in read-only mode that queue's props influence create/update ticket
 
     foreach my $variant ( @variants ) {
         set_queue_crypt_options( %$variant );
-        $m->goto_ticket( $id );
-        $m->follow_link_ok({text => 'Reply'}, '-> reply');
+        $m->get( $m->rt_base_url . "/Ticket/Update.html?Action=Respond&id=$id" );
         $m->form_number(3);
         if ( $variant->{'Encrypt'} ) {
             ok $m->value('Encrypt', 2), "encrypt tick box is checked";
@@ -283,8 +282,7 @@ sub update_ticket {
 
     RT::Test->clean_caught_mails;
 
-    ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
-    $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
+    $m->get( $m->rt_base_url . "/Ticket/Update.html?Action=Respond&id=$tid" );
     $m->form_number(3);
     $m->field( UpdateContent => 'Some content' );
 

commit 6dd331bb7b212608f882cd7fb718133298f4fa99
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 15:08:27 2010 -0400

    split apart t/web/gnupg-outgoing to actually separate two very different flows

diff --git a/t/web/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
similarity index 85%
rename from t/web/gnupg-outgoing.t
rename to t/mail/gnupg-outgoing.t
index 9eb56f4..728eda7 100644
--- a/t/web/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 456;
+use RT::Test tests => 430;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -63,52 +63,6 @@ my %mail = (
     signed_encrypted => [],
 );
 
-diag "check in read-only mode that queue's props influence create/update ticket pages";
-{
-    foreach my $variant ( @variants ) {
-        set_queue_crypt_options( %$variant );
-        $m->goto_create_ticket( $queue );
-        $m->form_name('TicketCreate');
-        if ( $variant->{'Encrypt'} ) {
-            ok $m->value('Encrypt', 2), "encrypt tick box is checked";
-        } else {
-            ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
-        }
-        if ( $variant->{'Sign'} ) {
-            ok $m->value('Sign', 2), "sign tick box is checked";
-        } else {
-            ok !$m->value('Sign', 2), "sign tick box is unchecked";
-        }
-    }
-
-    # to avoid encryption/signing during create
-    set_queue_crypt_options();
-
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
-    my ($id) = $ticket->Create(
-        Subject   => 'test',
-        Queue     => $queue->id,
-        Requestor => 'rt-test at example.com',
-    );
-    ok $id, 'ticket created';
-
-    foreach my $variant ( @variants ) {
-        set_queue_crypt_options( %$variant );
-        $m->get( $m->rt_base_url . "/Ticket/Update.html?Action=Respond&id=$id" );
-        $m->form_number(3);
-        if ( $variant->{'Encrypt'} ) {
-            ok $m->value('Encrypt', 2), "encrypt tick box is checked";
-        } else {
-            ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
-        }
-        if ( $variant->{'Sign'} ) {
-            ok $m->value('Sign', 2), "sign tick box is checked";
-        } else {
-            ok !$m->value('Sign', 2), "sign tick box is unchecked";
-        }
-    }
-}
-
 # create a ticket for each combination
 foreach my $queue_set ( @variants ) {
     set_queue_crypt_options( %$queue_set );
diff --git a/t/web/gnupg-tickyboxes.t b/t/web/gnupg-tickyboxes.t
new file mode 100644
index 0000000..c5c14aa
--- /dev/null
+++ b/t/web/gnupg-tickyboxes.t
@@ -0,0 +1,156 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+
+use RT::Test tests => 30;
+
+plan skip_all => 'GnuPG required.'
+    unless eval 'use GnuPG::Interface; 1';
+plan skip_all => 'gpg executable is required.'
+    unless RT::Test->find_executable('gpg');
+
+
+use RT::Action::SendEmail;
+use File::Temp qw(tempdir);
+
+RT::Test->set_mail_catcher;
+
+use_ok('RT::Crypt::GnuPG');
+
+RT->Config->Set( GnuPG =>
+    Enable => 1,
+    OutgoingMessagesFormat => 'RFC',
+);
+
+RT->Config->Set( GnuPGOptions =>
+    homedir => scalar tempdir( CLEANUP => 1 ),
+    passphrase => 'rt-test',
+    'no-permission-warning' => undef,
+    'trust-model' => 'always',
+);
+RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
+
+RT::Test->import_gnupg_key('rt-recipient at example.com');
+RT::Test->import_gnupg_key('rt-test at example.com', 'public');
+
+my $queue = RT::Test->load_or_create_queue(
+    Name              => 'Regression',
+    CorrespondAddress => 'rt-recipient at example.com',
+    CommentAddress    => 'rt-recipient at example.com',
+);
+ok $queue && $queue->id, 'loaded or created queue';
+
+RT::Test->set_rights(
+    Principal => 'Everyone',
+    Right => ['CreateTicket', 'ShowTicket', 'SeeQueue', 'ReplyToTicket', 'ModifyTicket'],
+);
+
+my ($baseurl, $m) = RT::Test->started_ok;
+ok $m->login, 'logged in';
+
+my @variants = (
+    {},
+    { Sign => 1 },
+    { Encrypt => 1 },
+    { Sign => 1, Encrypt => 1 },
+);
+
+# collect emails
+my %mail = (
+    plain            => [],
+    signed           => [],
+    encrypted        => [],
+    signed_encrypted => [],
+);
+
+diag "check in read-only mode that queue's props influence create/update ticket pages";
+{
+    foreach my $variant ( @variants ) {
+        set_queue_crypt_options( %$variant );
+        $m->goto_create_ticket( $queue );
+        $m->form_name('TicketCreate');
+        if ( $variant->{'Encrypt'} ) {
+            ok $m->value('Encrypt', 2), "encrypt tick box is checked";
+        } else {
+            ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
+        }
+        if ( $variant->{'Sign'} ) {
+            ok $m->value('Sign', 2), "sign tick box is checked";
+        } else {
+            ok !$m->value('Sign', 2), "sign tick box is unchecked";
+        }
+    }
+
+    # to avoid encryption/signing during create
+    set_queue_crypt_options();
+
+    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my ($id) = $ticket->Create(
+        Subject   => 'test',
+        Queue     => $queue->id,
+        Requestor => 'rt-test at example.com',
+    );
+    ok $id, 'ticket created';
+
+    foreach my $variant ( @variants ) {
+        set_queue_crypt_options( %$variant );
+        $m->get( $m->rt_base_url . "/Ticket/Update.html?Action=Respond&id=$id" );
+        $m->form_number(3);
+        if ( $variant->{'Encrypt'} ) {
+            ok $m->value('Encrypt', 2), "encrypt tick box is checked";
+        } else {
+            ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
+        }
+        if ( $variant->{'Sign'} ) {
+            ok $m->value('Sign', 2), "sign tick box is checked";
+        } else {
+            ok !$m->value('Sign', 2), "sign tick box is unchecked";
+        }
+    }
+}
+
+
+sub create_a_ticket {
+    my %args = (@_);
+
+    RT::Test->clean_caught_mails;
+
+    $m->goto_create_ticket( $queue );
+    $m->form_name('TicketCreate');
+    $m->field( Subject    => 'test' );
+    $m->field( Requestors => 'rt-test at example.com' );
+    $m->field( Content    => 'Some content' );
+
+    foreach ( qw(Sign Encrypt) ) {
+        if ( $args{ $_ } ) {
+            $m->tick( $_ => 1 );
+        } else {
+            $m->untick( $_ => 1 );
+        }
+    }
+
+    $m->submit;
+    is $m->status, 200, "request successful";
+
+    unlike($m->content, qr/unable to sign outgoing email messages/);
+
+    $m->get_ok('/'); # ensure that the mail has been processed
+
+    my @mail = RT::Test->fetch_caught_mails;
+    check_text_emails( \%args, @mail );
+}
+
+sub set_queue_crypt_options {
+    my %args = @_;
+    $m->get_ok("/Admin/Queues/Modify.html?id=". $queue->id);
+    $m->form_with_fields('Sign', 'Encrypt');
+    foreach my $opt ('Sign', 'Encrypt') {
+        if ( $args{$opt} ) {
+            $m->tick($opt => 1);
+        } else {
+            $m->untick($opt => 1);
+        }
+    }
+    $m->submit;
+}
+

commit d9bc12f57cc0c60fae2cb94b1741c7b804748a0b
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 15:45:00 2010 -0400

    Rather than testing the webui's ability to process ticky boxes (like we do in other tests)
    just update the $queue object.

diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index 728eda7..7d421ac 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 430;
+use RT::Test tests => 422;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -301,15 +301,7 @@ sub cleanup_headers {
 
 sub set_queue_crypt_options {
     my %args = @_;
-    $m->get_ok("/Admin/Queues/Modify.html?id=". $queue->id);
-    $m->form_with_fields('Sign', 'Encrypt');
-    foreach my $opt ('Sign', 'Encrypt') {
-        if ( $args{$opt} ) {
-            $m->tick($opt => 1);
-        } else {
-            $m->untick($opt => 1);
-        }
-    }
-    $m->submit;
+            $queue->SetEncrypt($args{'Encrypt'});
+            $queue->SetSign($args{'Sign'});
 }
 

commit f9e3cc84058a99ac3888d4d71cdf4b09ae125624
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 30 15:46:56 2010 -0400

    shave off a couple (30+) more heavy loads of /.

diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index 7d421ac..358459f 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 422;
+use RT::Test tests => 390;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -224,7 +224,6 @@ sub create_a_ticket {
 
     unlike($m->content, qr/unable to sign outgoing email messages/);
 
-    $m->get_ok('/'); # ensure that the mail has been processed
 
     my @mail = RT::Test->fetch_caught_mails;
     check_text_emails( \%args, @mail );
@@ -252,7 +251,6 @@ sub update_ticket {
     is $m->status, 200, "request successful";
     $m->content_like(qr/Message recorded/, 'Message recorded') or diag $m->content;
 
-    $m->get_ok('/'); # ensure that the mail has been processed
 
     my @mail = RT::Test->fetch_caught_mails;
     check_text_emails( \%args, @mail );

commit 654ce58c77177b5115ea52f87e9321c784ce2e03
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 16:38:45 2010 -0400

    Test most of the reverification warnings

diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t
index 9fc9ad3..327916c 100644
--- a/t/mail/gnupg-reverification.t
+++ b/t/mail/gnupg-reverification.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 120;
+use RT::Test tests => 188;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -74,6 +74,15 @@ foreach my $file ( @files ) {
     );
     $m->content_like(qr/This is .*ID:$eid/ims, "$eid: content is there and message is decrypted");
 
+    $m->next_warning_like(qr/public key not found/);
+
+    # some mails contain multiple signatures
+    if ($eid == 5 || $eid == 17 || $eid == 18) {
+        $m->next_warning_like(qr/public key not found/);
+    }
+
+    $m->no_leftover_warnings_ok;
+
     push @ticket_ids, $id;
 }
 
@@ -88,5 +97,7 @@ foreach my $id ( @ticket_ids ) {
         qr/The signature is good/is,
         "signature is re-verified and now good",
     );
+
+    $m->no_warnings_ok;
 }
 

commit f7b96a8c59005251ac7c579c119b1362686e1663
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 16:49:58 2010 -0400

    Test the warnings thrown by mailgate

diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t
index 327916c..e2ffbe0 100644
--- a/t/mail/gnupg-reverification.t
+++ b/t/mail/gnupg-reverification.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 188;
+use RT::Test tests => 214;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -58,10 +58,23 @@ foreach my $file ( @files ) {
     my $email_content = RT::Test->file_content( $file );
     ok $email_content, "$eid: got content of email";
 
-    my ($status, $id) = RT::Test->send_via_mailgate( $email_content );
+    my $warnings;
+    my ($status, $id);
+
+    {
+        local $SIG{__WARN__} = sub {
+            $warnings .= "@_";
+        };
+
+        ($status, $id) = RT::Test->send_via_mailgate( $email_content );
+    }
+
     is $status >> 8, 0, "$eid: the mail gateway exited normally";
     ok $id, "$eid: got id of a newly created ticket - $id";
 
+    like($warnings, qr/Had a problem during decrypting and verifying/);
+    like($warnings, qr/public key not found/);
+
     my $ticket = RT::Ticket->new( $RT::SystemUser );
     $ticket->Load( $id );
     ok $ticket->id, "$eid: loaded ticket #$id";

commit 5a3d2ef39494f58df5b9812321d26235147dde03
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 16:54:00 2010 -0400

    Test gnupg-select-keys-on-create.t's warnings

diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index d05c619..42c9e69 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 60;
+use RT::Test tests => 78;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -60,6 +60,7 @@ diag "check that signing doesn't work if there is no key";
         qr/unable to sign outgoing email messages/i,
         'problems with passphrase'
     );
+    $m->warning_like(qr/signing failed: secret key not available/);
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
@@ -96,6 +97,9 @@ diag "check that things don't work if there is no key";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->next_warning_like(qr/public key not found/) for 1 .. 4;
+    $m->no_leftover_warnings_ok;
 }
 
 diag "import first key of rt-test\@example.com";
@@ -143,6 +147,8 @@ diag "check that things still doesn't work if key is not trusted";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 diag "import a second key of rt-test\@example.com";
@@ -190,6 +196,8 @@ diag "check that things still doesn't work if two keys are not trusted";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 {
@@ -224,6 +232,8 @@ diag "check that we see key selector even if only one key is trusted but there a
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 diag "check that key selector works and we can select trusted key";
@@ -256,6 +266,8 @@ diag "check that key selector works and we can select trusted key";
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
     check_text_emails( { Encrypt => 1 }, @mail );
+
+    $m->no_warnings_ok;
 }
 
 diag "check encrypting of attachments";
@@ -289,6 +301,8 @@ diag "check encrypting of attachments";
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
     check_text_emails( { Encrypt => 1, Attachment => 1 }, @mail );
+
+    $m->no_warnings_ok;
 }
 
 sub check_text_emails {

commit 8fee0567b77999af67ae7bbd004811c74141ceed
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 17:00:06 2010 -0400

    test t/web/gnupg-select-keys-on-update.t's warnings

diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index ea4b577..c9f4cbc 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 68;
+use RT::Test tests => 85;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -75,6 +75,9 @@ diag "check that signing doesn't work if there is no key";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->next_warning_like(qr/secret key not available/);
+    $m->no_leftover_warnings_ok;
 }
 
 {
@@ -109,6 +112,9 @@ diag "check that things don't work if there is no key";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->next_warning_like(qr/public key not found/) for 1 .. 2;
+    $m->no_leftover_warnings_ok;
 }
 
 
@@ -158,6 +164,8 @@ diag "check that things still doesn't work if key is not trusted";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 diag "import a second key of rt-test\@example.com";
@@ -206,6 +214,8 @@ diag "check that things still doesn't work if two keys are not trusted";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 {
@@ -241,6 +251,8 @@ diag "check that we see key selector even if only one key is trusted but there a
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
+
+    $m->no_warnings_ok;
 }
 
 diag "check that key selector works and we can select trusted key";
@@ -274,6 +286,8 @@ diag "check that key selector works and we can select trusted key";
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
     check_text_emails( { Encrypt => 1 }, @mail );
+
+    $m->no_warnings_ok;
 }
 
 diag "check encrypting of attachments";
@@ -308,6 +322,8 @@ diag "check encrypting of attachments";
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
     check_text_emails( { Encrypt => 1, Attachment => 1 }, @mail );
+
+    $m->no_warnings_ok;
 }
 
 sub check_text_emails {

commit 2074dead3152c9e5733b273b58b79c9e800f40e9
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 17:02:55 2010 -0400

    Test one of the t/web/crypt-gnupg.t warnings

diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index fb28c88..de75f58 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 94;
+use RT::Test tests => 95;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -379,9 +379,18 @@ To: general\@example.com
 hello
 MAIL
  
-((my $status), $id) = RT::Test->send_via_mailgate($mail);
+my ($warnings, $status);
+{
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
+    ($status, $id) = RT::Test->send_via_mailgate($mail);
+}
+
 is ($status >> 8, 0, "The mail gateway exited normally");
 ok ($id, "got id of a newly created ticket - $id");
+like($warnings, qr/nokey\@example.com: skipped: public key not found/);
 
 $tick = RT::Ticket->new( $RT::SystemUser );
 $tick->Load( $id );

commit 2a7b6217d5229244b1deec33344e15051dd38cbf
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 17:10:15 2010 -0400

    Test t/mail/crypt-gnupg.t's warnings

diff --git a/t/mail/crypt-gnupg.t b/t/mail/crypt-gnupg.t
index 0356099..1405f13 100644
--- a/t/mail/crypt-gnupg.t
+++ b/t/mail/crypt-gnupg.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 92;
+use RT::Test nodata => 1, tests => 97;
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
 plan skip_all => 'gpg executable is required.'
@@ -69,6 +69,11 @@ diag 'only signing. correct passphrase';
 
 diag 'only signing. missing passphrase';
 {
+    my $warnings;
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
     my $entity = MIME::Entity->build(
         From    => 'rt at example.com',
         Subject => 'test',
@@ -82,10 +87,17 @@ diag 'only signing. missing passphrase';
     is( scalar @status, 1, 'one record');
     is( $status[0]->{'Operation'}, 'PassphraseCheck', 'operation is correct');
     is( $status[0]->{'Status'}, 'MISSING', 'missing passphrase');
+
+    like($warnings, qr/bad passphrase/);
 }
 
 diag 'only signing. wrong passphrase';
 {
+    my $warnings;
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
     my $entity = MIME::Entity->build(
         From    => 'rt at example.com',
         Subject => 'test',
@@ -99,6 +111,8 @@ diag 'only signing. wrong passphrase';
     is( scalar @status, 1, 'one record');
     is( $status[0]->{'Operation'}, 'PassphraseCheck', 'operation is correct');
     is( $status[0]->{'Status'}, 'BAD', 'wrong passphrase');
+
+    like($warnings, qr/bad passphrase/);
 }
 
 diag 'encryption only';
@@ -129,6 +143,11 @@ diag 'encryption only';
 
 diag 'encryption only, bad recipient';
 {
+    my $warnings;
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
     my $entity = MIME::Entity->build(
         From    => 'rt at example.com',
         To      => 'keyless at example.com',
@@ -142,6 +161,8 @@ diag 'encryption only, bad recipient';
     my @status = RT::Crypt::GnuPG::ParseStatus( $res{'status'} );
     is( scalar @status, 1, 'one record');
     is( $status[0]->{'Keyword'}, 'INV_RECP', 'invalid recipient');
+
+    like($warnings, qr/public key not found/);
 }
 
 diag 'encryption and signing with combined method';
@@ -221,6 +242,11 @@ diag 'find signed/encrypted part deep inside';
 
 diag 'wrong signed/encrypted parts: no protocol';
 {
+    my $warnings;
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
     my $entity = MIME::Entity->build(
         From    => 'rt at example.com',
         To      => 'rt at example.com',
@@ -233,10 +259,17 @@ diag 'wrong signed/encrypted parts: no protocol';
 
     my @parts = RT::Crypt::GnuPG::FindProtectedParts( Entity => $entity );
     is( scalar @parts, 0, 'no protected parts' );
+
+    like($warnings, qr{Entity is 'multipart/encrypted', but has no protocol defined. Skipped});
 }
 
 diag 'wrong signed/encrypted parts: not enought parts';
 {
+    my $warnings;
+    local $SIG{__WARN__} = sub {
+        $warnings .= "@_";
+    };
+
     my $entity = MIME::Entity->build(
         From    => 'rt at example.com',
         To      => 'rt at example.com',
@@ -249,6 +282,8 @@ diag 'wrong signed/encrypted parts: not enought parts';
 
     my @parts = RT::Crypt::GnuPG::FindProtectedParts( Entity => $entity );
     is( scalar @parts, 0, 'no protected parts' );
+
+    like($warnings, qr/Encrypted or signed entity must has two subparts. Skipped/);
 }
 
 diag 'wrong signed/encrypted parts: wrong proto';

commit ad5107929a95f5fdf4c297d37dbf22a368aec730
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Aug 28 17:44:37 2010 -0400

    Rename the original fckeditor.html so it doesn't get caught by compilation-errors.t
    
        Looks like it's there purely for reference

diff --git a/share/html/NoAuth/RichText/FCKeditor/editor/fckeditor.original.html b/share/html/NoAuth/RichText/FCKeditor/editor/fckeditor.html.original
similarity index 100%
rename from share/html/NoAuth/RichText/FCKeditor/editor/fckeditor.original.html
rename to share/html/NoAuth/RichText/FCKeditor/editor/fckeditor.html.original

commit 3dd45c716ac71f2a4a895bf869b38dba7c6548ae
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 13:05:20 2010 -0400

    t/web/crypt-gnupg.t: Test for warnings

diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index de75f58..56fbad1 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 95;
+use RT::Test tests => 101;
 
 plan skip_all => 'GnuPG required.'
     unless eval 'use GnuPG::Interface; 1';
@@ -432,6 +432,8 @@ like($m->content, qr/$key2/, "second key shows up in preferences");
 like($m->content, qr/$key1/, "first key shows up in preferences");
 like($m->content, qr/$key2.*?$key1/s, "second key (now preferred) shows up before the first");
 
+$m->no_warnings_ok;
+
 # test that the new fields work
 $m->get("$baseurl/Search/Simple.html?q=General");
 my $content = $m->content;
@@ -450,6 +452,10 @@ like($content, qr/KO-nokey \(no pubkey!\)-K/, "KeyOwnerName issues no-pubkey war
 like($content, qr/KO-Nobody \(no pubkey!\)-K/, "KeyOwnerName issues no-pubkey warning for nobody");
 
 like($content, qr/KR-recipient\@example.com-K/, "KeyRequestors does not issue no-pubkey warning for recipient\@example.com");
+
 like($content, qr/KR-general\@example.com-K/, "KeyRequestors does not issue no-pubkey warning for general\@example.com");
 like($content, qr/KR-nokey\@example.com \(no pubkey!\)-K/, "KeyRequestors DOES issue no-pubkey warning for nokey\@example.com");
 
+$m->next_warning_like(qr/public key not found/);
+$m->next_warning_like(qr/public key not found/);
+$m->no_leftover_warnings_ok;

commit 62aa2c1906e027cfacef553b5d85d03196d5f1c0
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 14:02:19 2010 -0400

    Avoid undef warning in /Widgets/Form/Integer's loc()

diff --git a/share/html/Widgets/Form/Integer b/share/html/Widgets/Form/Integer
index a5641f6..b5050f6 100644
--- a/share/html/Widgets/Form/Integer
+++ b/share/html/Widgets/Form/Integer
@@ -68,7 +68,7 @@ $CurrentValue => '',
 
 $Default        => 0,
 $DefaultValue   => 0,
-$DefaultLabel   => loc( 'Default: [_1]', $DefaultValue ),
+$DefaultLabel   => loc( 'Default: [_1]', $DefaultValue || '' ),
 </%ARGS>
 
 <%METHOD InputOnly>

commit bf5702f332664060202bfceb280c1a474ef41c26
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 14:07:35 2010 -0400

    Avoid weird exit values caused by expect_quit

diff --git a/t/web/command_line.t b/t/web/command_line.t
index d32677a..d1eb9d1 100644
--- a/t/web/command_line.t
+++ b/t/web/command_line.t
@@ -540,3 +540,4 @@ sub check_attachment {
     }
 }
 
+1; # needed to avoid a weird exit value from expect_quit
diff --git a/t/web/command_line_with_unknown_field.t b/t/web/command_line_with_unknown_field.t
index 9a7ec7a..1f87cb8 100644
--- a/t/web/command_line_with_unknown_field.t
+++ b/t/web/command_line_with_unknown_field.t
@@ -32,3 +32,5 @@ expect_like(qr/homer: Unknown field/, 'homer is unknown field');
 expect_like(qr/homer: simpson/, 'the value we set for homer is shown too');
 
 expect_quit();
+
+1; # needed to avoid a weird exit value from expect_quit

commit 9b6adc40ba4d1c81f72a216d4b8e30657f226658
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 14:15:05 2010 -0400

    Noon causes a spurious warning in Time::ParseDate ([rt.cpan.org #60705])

diff --git a/t/api/cf_date_search.t b/t/api/cf_date_search.t
index aea2925..6039fd0 100644
--- a/t/api/cf_date_search.t
+++ b/t/api/cf_date_search.t
@@ -109,9 +109,9 @@ ok(
     $ticket->Create(
         Queue                    => $q->id,
         Subject                  => 'Test',
-        'CustomField-' . $cf->id => '2010-05-04 12:34:56',
+        'CustomField-' . $cf->id => '2010-05-04 11:34:56',
     ),
-    'create ticket with cf set to 2010-05-04 12:34:56'
+    'create ticket with cf set to 2010-05-04 11:34:56'
 );
 
 is( $ticket->CustomFieldValues->First->Content,
diff --git a/t/api/cf_datetime_search.t b/t/api/cf_datetime_search.t
index 44582e1..cc2915c 100644
--- a/t/api/cf_datetime_search.t
+++ b/t/api/cf_datetime_search.t
@@ -27,14 +27,14 @@ ok(
     $ticket->Create(
         Queue                    => $q->id,
         Subject                  => 'Test',
-        'CustomField-' . $cf->id => '2010-05-04 08:00:00',
+        'CustomField-' . $cf->id => '2010-05-04 07:00:00',
     ),
-    'create ticket with cf set to 2010-05-04 08:00:00( 2010-05-04 12:00:00 with UTC )'
+    'create ticket with cf set to 2010-05-04 07:00:00( 2010-05-04 11:00:00 with UTC )'
 );
 
 is(
     $ticket->CustomFieldValues->First->Content,
-    '2010-05-04 12:00:00',
+    '2010-05-04 11:00:00',
     'date in db is in timezone UTC'
 );
 
@@ -44,10 +44,10 @@ is(
     $tickets->LimitCustomField(
         CUSTOMFIELD => $cf->id,
         OPERATOR    => '=',
-        VALUE       => '2010-05-04 12:00:00',    # this timezone is UTC
+        VALUE       => '2010-05-04 11:00:00',    # this timezone is UTC
     );
 
-    is( $tickets->Count, 1, 'found the ticket with exact date: 2010-05-04 12:00:00' );
+    is( $tickets->Count, 1, 'found the ticket with exact date: 2010-05-04 11:00:00' );
 }
 
 {

commit 9c6bd46306e87778f47615a0cd40250d9e7f15c6
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 14:21:52 2010 -0400

    We now have a t/customfields subdir, so use it

diff --git a/t/api/cf.t b/t/customfields/api.t
similarity index 100%
rename from t/api/cf.t
rename to t/customfields/api.t
diff --git a/t/api/cf_combo_cascade.t b/t/customfields/combo_cascade.t
similarity index 100%
rename from t/api/cf_combo_cascade.t
rename to t/customfields/combo_cascade.t
diff --git a/t/api/cf_date_search.t b/t/customfields/date_search.t
similarity index 100%
rename from t/api/cf_date_search.t
rename to t/customfields/date_search.t
diff --git a/t/api/cf_datetime_search.t b/t/customfields/datetime_search.t
similarity index 100%
rename from t/api/cf_datetime_search.t
rename to t/customfields/datetime_search.t
diff --git a/t/api/cf_external.t b/t/customfields/external.t
similarity index 100%
rename from t/api/cf_external.t
rename to t/customfields/external.t
diff --git a/t/api/cf_pattern.t b/t/customfields/pattern.t
similarity index 100%
rename from t/api/cf_pattern.t
rename to t/customfields/pattern.t
diff --git a/t/api/cf_single_values.t b/t/customfields/single_values.t
similarity index 100%
rename from t/api/cf_single_values.t
rename to t/customfields/single_values.t
diff --git a/t/api/cf_transaction.t b/t/customfields/transaction.t
similarity index 100%
rename from t/api/cf_transaction.t
rename to t/customfields/transaction.t

commit 705e2e5c3c48e2479e0813d84eb126b979b8d9dc
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 30 14:44:50 2010 -0400

    Turn this decode_base64 weirdness into a real failing test

diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 06925ef..5612cbb 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -3,7 +3,7 @@
 use strict;
 use File::Spec ();
 
-use RT::Test tests => 137;
+use RT::Test tests => 138;
 
 use RT::EmailParser;
 use RT::Tickets;
@@ -406,17 +406,21 @@ is (count_attachs($tick) , 5 , "Has one attachment, presumably a text-plain and
 sub text_plain_nested_redef_sendmessage {
     no warnings qw/redefine/;
     eval 'sub RT::Action::SendEmail::SendMessage { 
-                my $self = shift; 
-                my $MIME = shift; 
-                return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
-                is ($MIME->head->mime_type , "multipart/mixed", "It is a mixed multipart");
-                 my $subject  =  $MIME->head->get("subject");
-                 $subject  = MIME::Base64::decode_base64( $subject);
-                chomp($subject);
-                # TODO, why does this test fail
-                #ok($subject =~ /Niv\x{e5}er/, "The subject matches the word - $subject");
-                1;
-                 }';
+        my $self = shift;
+        my $MIME = shift;
+
+        return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
+
+        is ($MIME->head->mime_type , "multipart/mixed", "It is a mixed multipart");
+
+        my $encoded_subject = $MIME->head->get("subject");
+        warn "<$encoded_subject>";
+        my $subject = MIME::Base64::decode_base64($encoded_subject);
+
+        like($subject, qr/Niv\x{e5}er/, "The subject matches the word - $subject");
+
+        1;
+    }';
 }
 
 # }}}

commit 0994d141c4bb5ce9cd6314e9fbada15b1a5bd525
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 15:49:57 2010 -0400

    Remove an accidentally-committed warning

diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 5612cbb..47a7b08 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -414,7 +414,6 @@ sub text_plain_nested_redef_sendmessage {
         is ($MIME->head->mime_type , "multipart/mixed", "It is a mixed multipart");
 
         my $encoded_subject = $MIME->head->get("subject");
-        warn "<$encoded_subject>";
         my $subject = MIME::Base64::decode_base64($encoded_subject);
 
         like($subject, qr/Niv\x{e5}er/, "The subject matches the word - $subject");

commit 6e3077e7294b192e45ea1ac87a3d2af7ae5d7d79
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Aug 31 16:26:07 2010 -0400

    use MIME::Words to decode MIME::Words encoded headers.

diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 47a7b08..62f156f 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -413,9 +413,10 @@ sub text_plain_nested_redef_sendmessage {
 
         is ($MIME->head->mime_type , "multipart/mixed", "It is a mixed multipart");
 
+        use MIME::Words qw(:all);
         my $encoded_subject = $MIME->head->get("subject");
-        my $subject = MIME::Base64::decode_base64($encoded_subject);
-
+        my $subject = decode_mimewords($encoded_subject);
+        
         like($subject, qr/Niv\x{e5}er/, "The subject matches the word - $subject");
 
         1;

commit 541a36b52a2594f2e3d8e0c3726a31ceeb6139dc
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 16:51:40 2010 -0400

    No need to use eval for redefining methods

diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 62f156f..de159e8 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -22,13 +22,13 @@ is (__PACKAGE__, 'main', "We're operating in the main package");
 
 {
     no warnings qw/redefine/;
-    sub RT::Action::SendEmail::SendMessage {
+    *RT::Action::SendEmail::SendMessage = sub {
         my $self = shift;
         my $MIME = shift;
 
         main::_fired_scrip($self->ScripObj);
         main::is(ref($MIME) , 'MIME::Entity', "hey, look. it's a mime entity");
-    }
+    };
 }
 
 # some utils
@@ -192,8 +192,7 @@ sub _fired_scrip {
 
 sub utf8_redef_sendmessage {
     no warnings qw/redefine/;
-    eval ' 
-    sub RT::Action::SendEmail::SendMessage {
+    *RT::Action::SendEmail::SendMessage = sub {
         my $self = shift;
         my $MIME = shift;
 
@@ -201,26 +200,25 @@ sub utf8_redef_sendmessage {
         ok(1, $self->ScripObj->ConditionObj->Name . " ".$self->ScripObj->ActionObj->Name);
         main::_fired_scrip($self->ScripObj);
         $MIME->make_singlepart;
-        main::is( ref($MIME) , \'MIME::Entity\',
-                  "hey, look. it\'s a mime entity" );
-        main::is( ref( $MIME->head ) , \'MIME::Head\',
+        main::is( ref($MIME) , 'MIME::Entity',
+                  "hey, look. it's a mime entity" );
+        main::is( ref( $MIME->head ) , 'MIME::Head',
                   "its mime header is a mime header. yay" );
-        main::like( $MIME->head->get(\'Content-Type\') , qr/utf-8/,
+        main::like( $MIME->head->get('Content-Type') , qr/utf-8/,
                   "Its content type is utf-8" );
         my $message_as_string = $MIME->bodyhandle->as_string();
         use Encode;
         $message_as_string = Encode::decode_utf8($message_as_string);
         main::like(
             $message_as_string , qr/H\x{e5}vard/,
-"The message\'s content contains havard\'s name. this will fail if it\'s not utf8 out");
+"The message's content contains havard's name. this will fail if it's not utf8 out");
 
-    }';
+    };
 }
 
 sub iso8859_redef_sendmessage {
     no warnings qw/redefine/;
-    eval ' 
-    sub RT::Action::SendEmail::SendMessage {
+    *RT::Action::SendEmail::SendMessage = sub {
         my $self = shift;
         my $MIME = shift;
 
@@ -228,19 +226,18 @@ sub iso8859_redef_sendmessage {
         ok(1, $self->ScripObj->ConditionObj->Name . " ".$self->ScripObj->ActionObj->Name);
         main::_fired_scrip($self->ScripObj);
         $MIME->make_singlepart;
-        main::is( ref($MIME) , \'MIME::Entity\',
-                  "hey, look. it\'s a mime entity" );
-        main::is( ref( $MIME->head ) , \'MIME::Head\',
+        main::is( ref($MIME) , 'MIME::Entity',
+                  "hey, look. it's a mime entity" );
+        main::is( ref( $MIME->head ) , 'MIME::Head',
                   "its mime header is a mime header. yay" );
-        main::like( $MIME->head->get(\'Content-Type\') , qr/iso-8859-1/,
+        main::like( $MIME->head->get('Content-Type') , qr/iso-8859-1/,
                   "Its content type is iso-8859-1 - " . $MIME->head->get("Content-Type") );
         my $message_as_string = $MIME->bodyhandle->as_string();
         use Encode;
         $message_as_string = Encode::decode("iso-8859-1",$message_as_string);
         main::like(
-            $message_as_string , qr/H\x{e5}vard/, "The message\'s content contains havard\'s name. this will fail if it\'s not utf8 out");
-
-    }';
+            $message_as_string , qr/H\x{e5}vard/, "The message's content contains havard's name. this will fail if it's not utf8 out");
+    };
 }
 
 # {{{ test a multipart alternative containing a text-html part with an umlaut
@@ -299,14 +296,14 @@ is (count_attachs($tick), 1 , "Has one attachment, presumably a text-html and a
 
 sub text_html_redef_sendmessage {
     no warnings qw/redefine/;
-    eval 'sub RT::Action::SendEmail::SendMessage { 
-                my $self = shift;
-                my $MIME = shift;
-                return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
-                is ($MIME->parts, 0, "generated correspondence mime entity
-                        does not have parts");
-                is ($MIME->head->mime_type , "text/plain", "The mime type is a plain");
-         }';
+    *RT::Action::SendEmail::SendMessage = sub {
+        my $self = shift;
+        my $MIME = shift;
+        return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
+        is ($MIME->parts, 0, "generated correspondence mime entity
+                does not have parts");
+        is ($MIME->head->mime_type , "text/plain", "The mime type is a plain");
+    };
 }
 
 # }}}
@@ -362,16 +359,15 @@ is (count_attachs($tick) ,1 , "Has one attachment, presumably a text-plain");
 is ($tick->Subject, "\x{442}\x{435}\x{441}\x{442} \x{442}\x{435}\x{441}\x{442}", "Recorded the subject right");
 sub text_plain_russian_redef_sendmessage {
     no warnings qw/redefine/;
-    eval 'sub RT::Action::SendEmail::SendMessage { 
-                my $self = shift; 
-                my $MIME = shift; 
-                return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
-                is ($MIME->head->mime_type , "text/plain", "The only part is text/plain ");
-                 my $subject  = $MIME->head->get("subject");
-                chomp($subject);
-                #is( $subject ,      /^=\?KOI8-R\?B\?W2V4YW1wbGUuY39tICM3XSDUxdPUINTF09Q=\?=/ , "The $subject is encoded correctly");
-                };
-                 ';
+    *RT::Action::SendEmail::SendMessage = sub {
+        my $self = shift; 
+        my $MIME = shift; 
+        return (1) unless ($self->ScripObj->ScripActionObj->Name eq "Notify AdminCcs" );
+        is ($MIME->head->mime_type , "text/plain", "The only part is text/plain ");
+            my $subject  = $MIME->head->get("subject");
+        chomp($subject);
+        #is( $subject ,      /^=\?KOI8-R\?B\?W2V4YW1wbGUuY39tICM3XSDUxdPUINTF09Q=\?=/ , "The $subject is encoded correctly");
+    };
 }
 
 my @input_encodings = RT->Config->Get( 'EmailInputEncodings' );
@@ -405,7 +401,7 @@ like (first_attach($tick)->ContentType , qr/multipart\/mixed/, "We recorded the
 is (count_attachs($tick) , 5 , "Has one attachment, presumably a text-plain and a message RFC 822 and another plain");
 sub text_plain_nested_redef_sendmessage {
     no warnings qw/redefine/;
-    eval 'sub RT::Action::SendEmail::SendMessage { 
+    *RT::Action::SendEmail::SendMessage = sub {
         my $self = shift;
         my $MIME = shift;
 
@@ -416,11 +412,11 @@ sub text_plain_nested_redef_sendmessage {
         use MIME::Words qw(:all);
         my $encoded_subject = $MIME->head->get("subject");
         my $subject = decode_mimewords($encoded_subject);
-        
+
         like($subject, qr/Niv\x{e5}er/, "The subject matches the word - $subject");
 
         1;
-    }';
+    };
 }
 
 # }}}

commit 1aaec46a9ccb1a543827ad6e0ab66f7cc83edc66
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 16:55:13 2010 -0400

    Use eval {} to try loading a module instead of eval ''

diff --git a/t/mail/crypt-gnupg.t b/t/mail/crypt-gnupg.t
index 1405f13..2bc9c3c 100644
--- a/t/mail/crypt-gnupg.t
+++ b/t/mail/crypt-gnupg.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::Test nodata => 1, tests => 97;
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-bad.t b/t/mail/gnupg-bad.t
index a3a2775..636fbfb 100644
--- a/t/mail/gnupg-bad.t
+++ b/t/mail/gnupg-bad.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 6;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-incoming.t b/t/mail/gnupg-incoming.t
index 5a841a7..ac59463 100644
--- a/t/mail/gnupg-incoming.t
+++ b/t/mail/gnupg-incoming.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 39;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index 358459f..e28451e 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 390;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-realmail.t b/t/mail/gnupg-realmail.t
index 9ee4024..99417cf 100644
--- a/t/mail/gnupg-realmail.t
+++ b/t/mail/gnupg-realmail.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 196;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t
index e2ffbe0..83621f7 100644
--- a/t/mail/gnupg-reverification.t
+++ b/t/mail/gnupg-reverification.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 214;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/mail/gnupg-special.t b/t/mail/gnupg-special.t
index 7e50819..e561beb 100644
--- a/t/mail/gnupg-special.t
+++ b/t/mail/gnupg-special.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 11;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index 56fbad1..d1f351d 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -4,15 +4,13 @@ use strict;
 use RT::Test tests => 101;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
 
 use RT::Action::SendEmail;
 
-eval 'use GnuPG::Interface; 1' or plan skip_all => 'GnuPG required.';
-
 RT::Test->set_mail_catcher;
 
 RT->Config->Set( CommentAddress => 'general at example.com');
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index 42c9e69..bb56f48 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 78;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index c9f4cbc..dd49b63 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 85;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
diff --git a/t/web/gnupg-tickyboxes.t b/t/web/gnupg-tickyboxes.t
index c5c14aa..b759ca7 100644
--- a/t/web/gnupg-tickyboxes.t
+++ b/t/web/gnupg-tickyboxes.t
@@ -5,7 +5,7 @@ use warnings;
 use RT::Test tests => 30;
 
 plan skip_all => 'GnuPG required.'
-    unless eval 'use GnuPG::Interface; 1';
+    unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 

commit 1e2fde0beae175846069d8ca90e2516932030879
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 17:33:43 2010 -0400

    Deal with lacking GnuPG::Interface better
    
        Test::More gets really cranky if you plan tests => 5 and then
        skip_all.

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 1b7f846..e8c9840 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -139,6 +139,9 @@ sub import {
         $class->builder->plan( tests => $args{'tests'} )
           unless $args{'tests'} eq 'no_declare';
     }
+    elsif ( exists $args{'tests'} ) {
+        # do nothing if they say "tests => undef" - let them make the plan
+    }
     else {
         $class->builder->no_plan unless $class->builder->has_plan;
     }
diff --git a/t/mail/crypt-gnupg.t b/t/mail/crypt-gnupg.t
index 2bc9c3c..237a43b 100644
--- a/t/mail/crypt-gnupg.t
+++ b/t/mail/crypt-gnupg.t
@@ -3,11 +3,12 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 97;
+use RT::Test nodata => 1, tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
+plan tests => 97;
 
 
 use File::Spec ();
diff --git a/t/mail/gnupg-bad.t b/t/mail/gnupg-bad.t
index 636fbfb..d0578ae 100644
--- a/t/mail/gnupg-bad.t
+++ b/t/mail/gnupg-bad.t
@@ -2,12 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 6;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
+plan tests => 6;
 
 
 use Cwd 'getcwd';
diff --git a/t/mail/gnupg-incoming.t b/t/mail/gnupg-incoming.t
index ac59463..dd31771 100644
--- a/t/mail/gnupg-incoming.t
+++ b/t/mail/gnupg-incoming.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 39;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 39;
 
 use File::Temp;
 use Cwd 'getcwd';
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index e28451e..1e8f1d2 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 390;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 390;
 
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
diff --git a/t/mail/gnupg-realmail.t b/t/mail/gnupg-realmail.t
index 99417cf..f56452a 100644
--- a/t/mail/gnupg-realmail.t
+++ b/t/mail/gnupg-realmail.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 196;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 196;
 
 use Digest::MD5 qw(md5_hex);
 
diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t
index 83621f7..0faed0f 100644
--- a/t/mail/gnupg-reverification.t
+++ b/t/mail/gnupg-reverification.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 214;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 214;
 
 use File::Temp qw(tempdir);
 my $homedir = tempdir( CLEANUP => 1 );
diff --git a/t/mail/gnupg-special.t b/t/mail/gnupg-special.t
index e561beb..625d7c8 100644
--- a/t/mail/gnupg-special.t
+++ b/t/mail/gnupg-special.t
@@ -2,12 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 11;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
+plan tests => 11;
 
 use File::Temp qw(tempdir);
 my $homedir = tempdir( CLEANUP => 1 );
diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index d1f351d..5e02077 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -1,13 +1,12 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 101;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 101;
 
 use RT::Action::SendEmail;
 
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index bb56f48..5777d1b 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 78;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 78;
 
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index dd49b63..ab99170 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 85;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 85;
 
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
diff --git a/t/web/gnupg-tickyboxes.t b/t/web/gnupg-tickyboxes.t
index b759ca7..7087c30 100644
--- a/t/web/gnupg-tickyboxes.t
+++ b/t/web/gnupg-tickyboxes.t
@@ -2,13 +2,12 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 30;
-
+use RT::Test tests => undef;
 plan skip_all => 'GnuPG required.'
     unless eval { require GnuPG::Interface; 1 };
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
-
+plan tests => 30;
 
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);

commit 801cd2dfc4f7aca3d500d752975b625fb9160dab
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 17:38:02 2010 -0400

    Clean up t/approval/basic.t's skip_all logic too

diff --git a/t/approval/basic.t b/t/approval/basic.t
index 5974591..5e2670d 100644
--- a/t/approval/basic.t
+++ b/t/approval/basic.t
@@ -1,15 +1,12 @@
-
 use strict;
 use warnings;
-use Test::More;
+use RT::Test tests => undef;
 BEGIN {
-    eval { require Email::Abstract; require Test::Email; 1 }
-        or plan skip_all => 'require Email::Abstract and Test::Email';
+    plan skip_all => 'Email::Abstract and Test::Email required.'
+        unless eval { require Email::Abstract; require Test::Email; 1 };
+    plan tests => 39;
 }
 
-
-use RT;
-use RT::Test tests => 39;
 use RT::Test::Email;
 
 RT->Config->Set( LogToScreen => 'debug' );

commit a74a206dcb6f1804f4ea94a8a34d3a955bae5f37
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 31 17:29:55 2010 -0400

    For MySQL, stop dropping privileges when we grant our own ACLs
    
    This also means that the DBA user no longer needs to have connect
    rights to the 'mysql' database.

diff --git a/etc/acl.mysql b/etc/acl.mysql
index 0982ca2..8d1d07e 100755
--- a/etc/acl.mysql
+++ b/etc/acl.mysql
@@ -14,9 +14,6 @@ sub acl {
     }
     print "Granting access to $db_user\@'$db_rthost' on $db_name.\n";
     return (
-        "USE mysql;",
-        "DELETE FROM user WHERE user = '$db_user';",
-        "DELETE FROM db where db = '$db_name';",
         "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
                ON $db_name.*
                TO '$db_user'\@'$db_rthost'

commit d9c81ab0a121e6f7d80f38c7e5bb7c4d3f58192c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 31 17:47:09 2010 -0400

    Escape database names passed to mysql's GRANT, for databases containing _ or %

diff --git a/etc/acl.mysql b/etc/acl.mysql
index 8d1d07e..1688237 100755
--- a/etc/acl.mysql
+++ b/etc/acl.mysql
@@ -13,9 +13,10 @@ sub acl {
         return;
     }
     print "Granting access to $db_user\@'$db_rthost' on $db_name.\n";
+    $db_name =~ s/([_%])/\\$1/g;
     return (
         "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
-               ON $db_name.*
+               ON `$db_name`.*
                TO '$db_user'\@'$db_rthost'
                IDENTIFIED BY '$db_pass';",
     );

commit 471d0739c45d4ddc45a4c6cd7c1e843bd702740e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 17:51:23 2010 -0400

    We unconditionally load DateTime so we don't need to eval guard loading it

diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm
index 28bab0e..ee9b6aa 100755
--- a/lib/RT/Date.pm
+++ b/lib/RT/Date.pm
@@ -119,8 +119,7 @@ our @FORMATTERS = (
     'RFC2616',       # loc
     'iCal',          # loc
 );
-if ( eval 'use DateTime qw(); 1;' && eval 'use DateTime::Locale qw(); 1;' && 
-     DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full') ) {
+if (DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full') ) {
     push @FORMATTERS, 'LocalizedDateTime'; # loc
 }
 
@@ -654,8 +653,6 @@ sub LocalizedDateTime
                  @_,
                );
 
-    return $self->loc("DateTime module missing") unless ( eval 'use DateTime qw(); 1;' );
-    return $self->loc("DateTime::Locale module missing") unless ( eval 'use DateTime::Locale qw(); 1;' );
     return $self->loc("DateTime doesn't support format_cldr, you must upgrade to use this feature") 
         unless can DateTime::('format_cldr');
 
diff --git a/lib/RT/Installer.pm b/lib/RT/Installer.pm
index 26786e4..d44c6ea 100644
--- a/lib/RT/Installer.pm
+++ b/lib/RT/Installer.pm
@@ -49,6 +49,7 @@
 package RT::Installer;
 use strict;
 use warnings;
+use DateTime;
 
 require UNIVERSAL::require;
 my %Meta = (
@@ -184,27 +185,7 @@ my %Meta = (
             Description => 'Path to sendmail', #loc
         },
     },
-    WebDomain => {
-        Widget          => '/Widgets/Form/String',
-        WidgetArguments => {
-            Description => 'Domain name',                  #loc
-            Hints => "Don't include http://, just something like 'localhost', 'rt.example.com'", #loc
-        },
-    },
-    WebPort => {
-        Widget          => '/Widgets/Form/Integer',
-        WidgetArguments => {
-            Description => 'Web port',                     #loc
-            Hints => 'which port your web server will listen to, e.g. 8080', #loc
-        },
-    },
-
-);
-
-my $HAS_DATETIME_TZ = eval { require DateTime::TimeZone };
-
-if ($HAS_DATETIME_TZ) {
-    $Meta{Timezone} = {
+    Timezone => {
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => 'Timezone',                              #loc
@@ -212,30 +193,34 @@ if ($HAS_DATETIME_TZ) {
                 my $ret;
                 $ret->{Values} = ['', DateTime::TimeZone->all_names];
 
-                my $has_datetime = eval { require DateTime };
-                if ( $has_datetime ) {
-                    my $dt = DateTime->now;
-                    for my $tz ( DateTime::TimeZone->all_names ) {
-                        $dt->set_time_zone( $tz );
-                        $ret->{ValuesLabel}{$tz} =
-                            $tz . ' ' . $dt->strftime('%z');
-                    }
+                my $dt = DateTime->now;
+                for my $tz ( DateTime::TimeZone->all_names ) {
+                    $dt->set_time_zone( $tz );
+                    $ret->{ValuesLabel}{$tz} =
+                        $tz . ' ' . $dt->strftime('%z');
                 }
                 $ret->{ValuesLabel}{''} = 'System Default'; #loc
 
                 return $ret;
             },
         },
-    };
-}
-else {
-    $Meta{Timezone} = {
+    },
+    WebDomain => {
         Widget          => '/Widgets/Form/String',
         WidgetArguments => {
-            Description => 'Timezone',                              #loc
+            Description => 'Domain name',                  #loc
+            Hints => "Don't include http://, just something like 'localhost', 'rt.example.com'", #loc
         },
-    };
-}
+    },
+    WebPort => {
+        Widget          => '/Widgets/Form/Integer',
+        WidgetArguments => {
+            Description => 'Web port',                     #loc
+            Hints => 'which port your web server will listen to, e.g. 8080', #loc
+        },
+    },
+
+);
 
 sub Meta {
     my $class = shift;
diff --git a/share/html/Elements/SelectTimezone b/share/html/Elements/SelectTimezone
index 75ac301..357a55e 100644
--- a/share/html/Elements/SelectTimezone
+++ b/share/html/Elements/SelectTimezone
@@ -46,26 +46,18 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <%ONCE>
-my $HAS_DATETIME_TZ = eval { require DateTime::TimeZone };
-my $HAS_DATETIME = eval { require DateTime };
+use DateTime;
 
-my (@names, %label);
-if ( $HAS_DATETIME_TZ ) {
-    @names = DateTime::TimeZone->all_names;
-}
+my @names = DateTime::TimeZone->all_names;
 
-if ( $HAS_DATETIME ) {
-    my $dt = DateTime->now;
-    for ( @names ) {
-        $dt->set_time_zone( $_ );
-        $label{$_} = $_ . ' ' . $dt->strftime('%z');
-    }
+my %label;
+my $dt = DateTime->now;
+for ( @names ) {
+    $dt->set_time_zone( $_ );
+    $label{$_} = $_ . ' ' . $dt->strftime('%z');
 }
 
 </%ONCE>
-% unless ( $HAS_DATETIME_TZ && @names ) {
-<input type="text" name="<% $Name %>" value="<% $Default %>" />
-% } else {
 <select name="<% $Name %>">
 % if ( $ShowNullOption ) {
 <option value=""><&|/l&>System Default</&></option>
@@ -75,7 +67,6 @@ if ( $HAS_DATETIME ) {
  |n %> ><% $label{$tz} || $tz %></option>
 % }
 </select>
-% }
 <%ARGS>
 $ShowNullOption => 1
 $Name => undef
diff --git a/t/api/date.t b/t/api/date.t
index ce51465..fb43d8c 100644
--- a/t/api/date.t
+++ b/t/api/date.t
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 use Test::MockTime qw(set_fixed_time restore_time);
+use DateTime;
 
 use Test::More;
 my $tests;
@@ -8,9 +9,7 @@ my $tests;
 my $localized_datetime_tests;
 BEGIN {
     $tests = 165;
-    $localized_datetime_tests =
-      eval { require DateTime; 1; } && eval { require DateTime::Locale; 1; } &&
-      DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full');
+    $localized_datetime_tests = DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full');
 
     if ($localized_datetime_tests) {
 

commit e59ede55dc00af2ae1f701feac8447bc3bc34674
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 31 17:56:39 2010 -0400

    Kill another indirect method call

diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm
index ee9b6aa..392114c 100755
--- a/lib/RT/Date.pm
+++ b/lib/RT/Date.pm
@@ -654,7 +654,7 @@ sub LocalizedDateTime
                );
 
     return $self->loc("DateTime doesn't support format_cldr, you must upgrade to use this feature") 
-        unless can DateTime::('format_cldr');
+        unless DateTime::->can('format_cldr');
 
 
     my $date_format = $args{'DateFormat'};

commit 59495e5d534a4965b621df8a9a380a04a7a95c8a
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Sep 1 22:22:02 2010 -0400

    Restore RT::SavedSearches::_PrivacyObjects but make it warn

diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm
index bc0ee43..72cc730 100644
--- a/lib/RT/SavedSearches.pm
+++ b/lib/RT/SavedSearches.pm
@@ -181,6 +181,13 @@ sub _GetObject {
     return RT::SavedSearch->new($self->CurrentUser)->_GetObject($privacy);
 }
 
+sub _PrivacyObjects {
+    my $self = shift;
+    Carp::carp("RT::SavedSearches->_PrivacyObjects is deprecated. Please use RT::SavedSearch->_PrivacyObjects");
+    my $search = RT::SavedSearch->new($self->CurrentUser);
+    return $search->_PrivacyObjects(@_);
+}
+
 RT::Base->_ImportOverlays();
 
 1;

commit 14133808d00cfd8d491146c87b1b5e7821ac2e26
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Thu Sep 2 20:08:18 2010 +0800

    Fix end of test email warnings.

diff --git a/lib/RT/Test/Email.pm b/lib/RT/Test/Email.pm
index c37861f..7903b55 100644
--- a/lib/RT/Test/Email.pm
+++ b/lib/RT/Test/Email.pm
@@ -122,7 +122,8 @@ END {
     if (scalar @mail) {
         diag ((scalar @mail)." uncaught notification email at end of test: ");
         diag "From: @{[ $_->header('From' ) ]}, Subject: @{[ $_->header('Subject') ]}"
-            for @mail;
+            for map { Email::Abstract->new($_)->cast('Email::Simple') } @mail;
+
         die;
     }
 }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list