[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-784-ge5dbe37

Shawn Moore sartak at bestpractical.com
Thu Sep 16 18:52:52 EDT 2010


The branch, 3.9-trunk has been updated
       via  e5dbe37e795630011fb113e000f72baca8f83433 (commit)
       via  30dd8b0a091461302c70bf98d49b56ac88c87cc3 (commit)
       via  0eeabf64cd4f9d0b062150cb97491ee93b9ff331 (commit)
       via  a72c73072cf204d4fb272cc6f218738b0ccd1174 (commit)
       via  82d8f8178c3a015623ccb06c32336d5bdc9edc3f (commit)
       via  1b9a4e48e78c0221da872de51d390d0e9ffbeb1f (commit)
       via  e108deed59b17ba5cb588f7c93c4e86ea966152c (commit)
       via  57eb5aadd59e87e66b673f82402214782c750fd3 (commit)
       via  d511e637565a545710da09fdce7933cb70f86724 (commit)
       via  201a98ac2a931ce6cc42facbd71ed53d64fe8e34 (commit)
      from  01b1befbb4b58fe5991d4cd9b2fc17d208da9fd1 (commit)

Summary of changes:
 docs/templates.pod                          |   44 +++++++++-------
 lib/RT/Test/Web.pm                          |    3 +-
 t/customfields/access_via_queue.t           |    8 ++--
 t/mail/gnupg-bad.t                          |    5 +-
 t/mail/gnupg-outgoing.t                     |    4 +-
 t/mail/gnupg-reverification.t               |    8 ++--
 t/ticket/scrips_batch.t                     |    2 +-
 t/web/attachments.t                         |   12 ++--
 t/web/basic.t                               |   20 ++++----
 t/web/cf_access.t                           |   16 +++---
 t/web/cf_date.t                             |   14 +++---
 t/web/cf_datetime.t                         |   24 +++++-----
 t/web/cf_onqueue.t                          |   10 ++--
 t/web/cf_select_one.t                       |   18 +++---
 t/web/compilation_errors.t                  |   16 +++---
 t/web/config_tab_right.t                    |    4 +-
 t/web/custom_frontpage.t                    |    6 +-
 t/web/custom_search.t                       |    2 +-
 t/web/dashboard_with_deleted_saved_search.t |    8 ++--
 t/web/gnupg-select-keys-on-create.t         |   68 +++++++++++++-------------
 t/web/gnupg-select-keys-on-update.t         |   72 +++++++++++++-------------
 t/web/gnupg-tickyboxes.t                    |    2 +-
 t/web/offline_utf8.t                        |    4 +-
 t/web/query_builder.t                       |    4 +-
 t/web/requestor_groups_edit_link.t          |    6 +-
 t/web/requestor_groups_limit.t              |    6 +-
 t/web/rights1.t                             |   19 +++----
 t/web/saved_search_chart.t                  |    8 ++--
 t/web/saved_search_permissions.t            |    2 +-
 t/web/search_rss.t                          |    5 +-
 t/web/template.t                            |    3 +-
 t/web/ticket-create-utf8.t                  |    8 ++--
 t/web/ticket_owner.t                        |   11 ++--
 t/web/ticket_owner_autocomplete.t           |   11 ++--
 t/web/ticket_seen.t                         |   18 +++---
 t/web/ticket_txn_content.t                  |   16 +++---
 t/web/ticket_update_without_content.t       |    8 ++--
 t/web/unlimited_search.t                    |   11 ++--
 38 files changed, 252 insertions(+), 254 deletions(-)

- Log -----------------------------------------------------------------
commit 201a98ac2a931ce6cc42facbd71ed53d64fe8e34
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 12:06:50 2010 -0400

    Tests: don't automatically logout during login
    
        This saves quite a few startup web requests. We rarely share mech in
        this way. To ensure that the logout codepath is still tested, do the
        usual logout dance for the tests that reuse mechs for different
        logins.

diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 5761f7c..39fa8e2 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -76,8 +76,9 @@ sub login {
     my $self = shift;
     my $user = shift || 'root';
     my $pass = shift || 'password';
+    my %args = @_;
     
-    $self->logout;
+    $self->logout if $args{logout};
 
     my $url = $self->rt_base_url;
     $self->get($url . "?user=$user;pass=$pass");
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index bbb2824..e5f1786 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -61,7 +61,7 @@ RT::Test->set_rights(
       Right => [qw(SeeQueue ShowTicket CreateTicket)],
     },
 );
-ok $m->login( $tester->Name, 123456), 'logged in';
+ok $m->login( $tester->Name, 123456, logout => 1), 'logged in';
 
 diag "check that we have no the CF on the create"
     ." ticket page when user has no SeeCustomField right";
diff --git a/t/web/cf_datetime.t b/t/web/cf_datetime.t
index 44146ec..af7d2b0 100644
--- a/t/web/cf_datetime.t
+++ b/t/web/cf_datetime.t
@@ -156,7 +156,7 @@ diag 'check search build page';
         Right  => 'SuperUser',
         Object => $RT::System,
     ));
-    $m->login( 'shanghai', 'password' );
+    $m->login( 'shanghai', 'password', logout => 1 );
 
     $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
     $m->form_number(3);
diff --git a/t/web/custom_frontpage.t b/t/web/custom_frontpage.t
index 79ea566..a1cd11a 100644
--- a/t/web/custom_frontpage.t
+++ b/t/web/custom_frontpage.t
@@ -31,7 +31,7 @@ $m->click_button (name => 'SavedSearchSave');
 $m->get ( $url.'Prefs/MyRT.html' );
 $m->content_like (qr/stupid tickets/, 'saved search listed in rt at a glance items');
 
-ok $m->login, 'we did log in as root';
+ok $m->login('root', 'password', logout => 1), 'we did log in as root';
 
 $m->get ( $url.'Prefs/MyRT.html' );
 $m->form_name ('SelectionBox-body');
diff --git a/t/web/saved_search_permissions.t b/t/web/saved_search_permissions.t
index f91ca13..7d6ece8 100644
--- a/t/web/saved_search_permissions.t
+++ b/t/web/saved_search_permissions.t
@@ -23,7 +23,7 @@ $m->submit_form(
 $m->content_contains( q{name="SavedSearchDescription" value="test"},
     'saved test search' );
 my ($id) = $m->content =~ /value="(RT::User-\d+-SavedSearch-\d+)"/;
-ok( $m->login( 'foo', 'foobar' ), 'logged in' );
+ok( $m->login( 'foo', 'foobar', logout => 1 ), 'logged in' );
 $m->get_ok( $url . "/Search/Build.html?SavedSearchLoad=$id" );
 
 my $message = qq{Can not load saved search "$id"};
diff --git a/t/web/search_rss.t b/t/web/search_rss.t
index 65dde30..4813963 100644
--- a/t/web/search_rss.t
+++ b/t/web/search_rss.t
@@ -64,7 +64,7 @@ my $user_b = RT::Test->load_or_create_user(
     Name => 'user_b', Password => 'password',
 );
 ok $user_b && $user_b->id, 'loaded or created user';
-$agent_b->login('user_b', 'password', 'logged in as user B');
+$agent_b->login('user_b', 'password');
 $agent_b->get_ok($noauth_uri);
 is( $agent_b->content_type, 'application/rss+xml', 'content type' );
 is( $agent_b->content, $rss_content, 'content' );

commit d511e637565a545710da09fdce7933cb70f86724
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 14:05:32 2010 -0400

    Use goto_ticket instead of manually constructing the link

diff --git a/t/web/offline_utf8.t b/t/web/offline_utf8.t
index 2a3e64d..98c3957 100644
--- a/t/web/offline_utf8.t
+++ b/t/web/offline_utf8.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 8;
+use RT::Test tests => 7;
 use File::Temp qw/tempfile/;
 use Encode;
 use RT::Ticket;
@@ -48,7 +48,7 @@ my $ticket = RT::Ticket->new( $RT::SystemUser );
 $ticket->Load( $ticket_id );
 is( $ticket->Subject, '标题', 'subject in $ticket is right' );
 
-$m->get_ok( $url . "/Ticket/Display.html?id=$ticket_id" );
+$m->goto_ticket($ticket_id);
 $m->content_contains( '这是正文',
     'content is right in ticket display page' );
 
diff --git a/t/web/requestor_groups_edit_link.t b/t/web/requestor_groups_edit_link.t
index af5aafb..d655ba7 100644
--- a/t/web/requestor_groups_edit_link.t
+++ b/t/web/requestor_groups_edit_link.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 11;
+use RT::Test tests => 9;
 
 RT->Config->Set( ShowMoreAboutPrivilegedUsers    => 1 );
 
@@ -34,7 +34,7 @@ ok( $id, 'created ticket' );
 my ( $url, $m ) = RT::Test->started_ok;
 ok( $m->login( user_a => 'password' ), 'logged in as user_a' );
 
-$m->get_ok( $url . '/Ticket/Display.html?id=' . $id );
+$m->goto_ticket($id);
 
 ok(
     !$m->find_link( text => 'Edit' ), 'no Edit link without AdminUsers permission'
@@ -50,7 +50,7 @@ ok(
     'add AdminUsers and ShowConfigTab rights for user_a'
 );
 
-$m->get_ok( $url . '/Ticket/Display.html?id=' . $id );
+$m->goto_ticket($id);
 $m->follow_link_ok( { text => 'Edit' }, 'follow the Edit link' );
 is( $m->uri, $url . "/Admin/Users/Memberships.html?id=" . $user_a->id, 'url is right' );
 
diff --git a/t/web/requestor_groups_limit.t b/t/web/requestor_groups_limit.t
index dd321cb..7ba5e4b 100644
--- a/t/web/requestor_groups_limit.t
+++ b/t/web/requestor_groups_limit.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 11;
+use RT::Test tests => 9;
 
 diag "set groups limit to 1";
 RT->Config->Set( ShowMoreAboutPrivilegedUsers    => 1 );
@@ -19,7 +19,7 @@ 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->goto_ticket($id);
 $m->content_like( qr/Everyone|Privileged/, 'got one group' );
 $m->content_unlike( qr/Everyone.*?Privileged/, 'not 2 groups' );
 
@@ -30,7 +30,7 @@ diag "set groups limit to 2";
 RT->Config->Set( MoreAboutRequestorGroupsLimit => 2 );
 ( $url, $m ) = RT::Test->started_ok;
 ok( $m->login(), 'logged in as root' );
-$m->get_ok( $url . '/Ticket/Display.html?id=' . $id );
+$m->goto_ticket($id);
 $m->content_contains( 'Everyone', 'got the first group' );
 $m->content_contains( 'Privileged', 'got the second group' );
 

commit 57eb5aadd59e87e66b673f82402214782c750fd3
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 14:08:35 2010 -0400

    Use goto_create_ticket instead of constructing the link manually

diff --git a/t/web/basic.t b/t/web/basic.t
index d170c84..18e0baa 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -26,7 +26,7 @@ my $url = $agent->rt_base_url;
 }
 
 {
-    $agent->get($url."Ticket/Create.html?Queue=1");
+    $agent->goto_create_ticket(1);
     is ($agent->{'status'}, 200, "Loaded Create.html");
     $agent->form_number(3);
     my $string = Encode::decode_utf8("I18N Web Testing æøå");
@@ -47,7 +47,7 @@ my $url = $agent->rt_base_url;
 }
 
 {
-    $agent->get($url."Ticket/Create.html?Queue=1");
+    $agent->goto_create_ticket(1);
     is ($agent->{'status'}, 200, "Loaded Create.html");
     $agent->form_number(3);
 

commit e108deed59b17ba5cb588f7c93c4e86ea966152c
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 14:10:16 2010 -0400

    Use the status method instead of pulling it out of mech's internals

diff --git a/t/web/basic.t b/t/web/basic.t
index 18e0baa..ed7034f 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -14,20 +14,20 @@ my $url = $agent->rt_base_url;
 # get the top page
 {
     $agent->get($url);
-    is ($agent->{'status'}, 200, "Loaded a page");
+    is ($agent->status, 200, "Loaded a page");
 }
 
 # test a login
 {
     $agent->login('root' => 'password');
     # the field isn't named, so we have to click link 0
-    is( $agent->{'status'}, 200, "Fetched the page ok");
+    is( $agent->status, 200, "Fetched the page ok");
     ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
 }
 
 {
     $agent->goto_create_ticket(1);
-    is ($agent->{'status'}, 200, "Loaded Create.html");
+    is ($agent->status, 200, "Loaded Create.html");
     $agent->form_number(3);
     my $string = Encode::decode_utf8("I18N Web Testing æøå");
     $agent->field('Subject' => "Ticket with utf8 body");
@@ -48,7 +48,7 @@ my $url = $agent->rt_base_url;
 
 {
     $agent->goto_create_ticket(1);
-    is ($agent->{'status'}, 200, "Loaded Create.html");
+    is ($agent->status, 200, "Loaded Create.html");
     $agent->form_number(3);
 
     my $string = Encode::decode_utf8("I18N Web Testing æøå");
diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index 6bc0358..34f9593 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -30,11 +30,11 @@ $agent->cookie_jar($cookie_jar);
 my $url = $agent->rt_base_url;
 $agent->get($url);
 
-is ($agent->{'status'}, 200, "Loaded a page");
+is($agent->status, 200, "Loaded a page");
 
 # follow the link marked "Login"
 $agent->login(root => 'password');
-is($agent->{'status'}, 200, "Fetched the page ok");
+is($agent->status, 200, "Fetched the page ok");
 like( $agent->{'content'} , qr/Logout/i, "Found a logout link");
 
 
@@ -51,7 +51,7 @@ sub test_get {
         $file =~ s#^share/html/##;
         diag( "testing $url/$file" );
         $agent->get_ok("$url/$file");
-        is ($agent->{'status'}, 200, "Loaded $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");
         ok( $agent->{'content'} !~ /raw error/i, "Didn't get a Mason compilation error on $file") or do {
diff --git a/t/web/rights1.t b/t/web/rights1.t
index 059b0b4..b4017c9 100644
--- a/t/web/rights1.t
+++ b/t/web/rights1.t
@@ -58,7 +58,7 @@ ok ($revokeid,$revokemsg);
 # Good.  Now load the search page and test Load/Save Search.
 $agent->follow_link( url => "$RT::WebPath/Search/Build.html",
 		     text => 'Tickets');
-is($agent->{'status'}, 200, "Fetched search builder page");
+is($agent->status, 200, "Fetched search builder page");
 ok($agent->{'content'} !~ /Load saved search/i, "No search loading box");
 ok($agent->{'content'} !~ /Saved searches/i, "No saved searches box");
 

commit 1b9a4e48e78c0221da872de51d390d0e9ffbeb1f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 14:28:57 2010 -0400

    Use content_like and content_unlike instead of ok, like, or unlike

diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index 1e8f1d2..6d8ca8b 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -221,7 +221,7 @@ sub create_a_ticket {
     $m->submit;
     is $m->status, 200, "request successful";
 
-    unlike($m->content, qr/unable to sign outgoing email messages/);
+    $m->content_unlike(qr/unable to sign outgoing email messages/);
 
 
     my @mail = RT::Test->fetch_caught_mails;
diff --git a/t/web/basic.t b/t/web/basic.t
index ed7034f..00363db 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -22,7 +22,7 @@ my $url = $agent->rt_base_url;
     $agent->login('root' => 'password');
     # the field isn't named, so we have to click link 0
     is( $agent->status, 200, "Fetched the page ok");
-    ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+    $agent->content_like(qr/Logout/i, "Found a logout link");
 }
 
 {
@@ -74,7 +74,7 @@ my $url = $agent->rt_base_url;
         fields => { TimeWorked => 5, 'TimeWorked-TimeUnits' => "hours" }
     );
 
-    like ($agent->{'content'}, qr/to &#39;300&#39;/, "5 hours is 300 minutes");
+    $agent->content_like(qr/to &#39;300&#39;/, "5 hours is 300 minutes");
 }
 
 # {{{ test an image
diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index 34f9593..fdf4cd1 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -35,7 +35,7 @@ is($agent->status, 200, "Loaded a page");
 # follow the link marked "Login"
 $agent->login(root => 'password');
 is($agent->status, 200, "Fetched the page ok");
-like( $agent->{'content'} , qr/Logout/i, "Found a logout link");
+$agent->content_like(qr/Logout/i, "Found a logout link");
 
 
 find ( sub { wanted() and test_get($File::Find::name) } , 'share/html/');
@@ -50,12 +50,12 @@ sub test_get {
 
         $file =~ s#^share/html/##;
         diag( "testing $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");
-        ok( $agent->{'content'} !~ /raw error/i, "Didn't get a Mason compilation error on $file") or do {
-            if (my ($error) = $agent->{'content'} =~ /<pre>(.*)/) {
+        $agent->content_unlike(qr/Not logged in/i, "Still logged in for  $file");
+        $agent->content_unlike(qr/raw error/i, "Didn't get a Mason compilation error on $file") or do {
+            if (my ($error) = $agent->content =~ /<pre>(.*)/) {
                 diag "$file: $error";
             }
         };
diff --git a/t/web/gnupg-tickyboxes.t b/t/web/gnupg-tickyboxes.t
index 7087c30..afbdc35 100644
--- a/t/web/gnupg-tickyboxes.t
+++ b/t/web/gnupg-tickyboxes.t
@@ -131,7 +131,7 @@ sub create_a_ticket {
     $m->submit;
     is $m->status, 200, "request successful";
 
-    unlike($m->content, qr/unable to sign outgoing email messages/);
+    $m->content_unlike(qr/unable to sign outgoing email messages/);
 
     $m->get_ok('/'); # ensure that the mail has been processed
 
diff --git a/t/web/rights1.t b/t/web/rights1.t
index b4017c9..57c23f2 100644
--- a/t/web/rights1.t
+++ b/t/web/rights1.t
@@ -42,7 +42,7 @@ ok($grantid,$grantmsg);
 
 $agent->reload;
 
-like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
+$agent->content_like(qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( url => "$RT::WebPath/Admin/",
 		       text => 'Configuration'), "Found config tab" );
 my ($revokeid,$revokemsg) =$user_obj->PrincipalObj->RevokeRight(Right => 'ShowConfigTab');
@@ -50,7 +50,7 @@ ok ($revokeid,$revokemsg);
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
 ok ($grantid,$grantmsg);
 $agent->reload();
-like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
+$agent->content_like(qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( 
 		       text => 'Preferences'), "Found prefs pane" );
 ($revokeid,$revokemsg) = $user_obj->PrincipalObj->RevokeRight(Right => 'ModifySelf');
@@ -59,22 +59,22 @@ ok ($revokeid,$revokemsg);
 $agent->follow_link( url => "$RT::WebPath/Search/Build.html",
 		     text => 'Tickets');
 is($agent->status, 200, "Fetched search builder page");
-ok($agent->{'content'} !~ /Load saved search/i, "No search loading box");
-ok($agent->{'content'} !~ /Saved searches/i, "No saved searches box");
+$agent->content_unlike(qr/Load saved search/i, "No search loading box");
+$agent->content_unlike(qr/Saved searches/i, "No saved searches box");
 
 ($grantid,$grantmsg) = $user_obj->PrincipalObj->GrantRight(Right => 'LoadSavedSearch');
 ok($grantid,$grantmsg);
 $agent->reload();
-like($agent->{'content'} , qr/Load saved search/i, "Search loading box exists");
-ok($agent->{'content'} !~ /input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i, 
+$agent->content_like(qr/Load saved search/i, "Search loading box exists");
+$agent->content_unlike(qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i,
    "Still no saved searches box");
 
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'CreateSavedSearch');
 ok ($grantid,$grantmsg);
 $agent->reload();
-like($agent->{'content'} , qr/Load saved search/i, 
+$agent->content_like(qr/Load saved search/i,
    "Search loading box still exists");
-like($agent->{'content'} , qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i, 
+$agent->content_like(qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i,
    "Saved searches box exists");
 
 # Create a group, and a queue, so we can test limited user visibility

commit 82d8f8178c3a015623ccb06c32336d5bdc9edc3f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 14:49:19 2010 -0400

    $m->login does exactly this and more for us

diff --git a/t/mail/gnupg-bad.t b/t/mail/gnupg-bad.t
index d0578ae..25d2c48 100644
--- a/t/mail/gnupg-bad.t
+++ b/t/mail/gnupg-bad.t
@@ -7,7 +7,7 @@ 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;
+plan tests => 5;
 
 
 use Cwd 'getcwd';
@@ -28,8 +28,7 @@ RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
 
 my ($baseurl, $m) = RT::Test->started_ok;
 
-$m->get( $baseurl."?user=root;pass=password" );
-$m->content_like(qr/Logout/, 'we did log in');
+$m->login;
 $m->get( $baseurl.'/Admin/Queues/');
 $m->follow_link_ok( {text => 'General'} );
 $m->submit_form( form_number => 3,

commit a72c73072cf204d4fb272cc6f218738b0ccd1174
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 15:08:53 2010 -0400

    Use content_contains and _lacks instead of _like and _unlike (where appropriate)

diff --git a/t/customfields/access_via_queue.t b/t/customfields/access_via_queue.t
index 2c442bf..0e8e5e1 100644
--- a/t/customfields/access_via_queue.t
+++ b/t/customfields/access_via_queue.t
@@ -115,7 +115,7 @@ diag "check that we have no the CF on the create";
     );
     my ($tid) = ($m->content =~ /Ticket (\d+) created/i);
     ok $tid, "created a ticket succesfully";
-    $m->content_unlike(qr/$cf_name/, "don't see CF");
+    $m->content_lacks($cf_name, "don't see CF");
 
     $m->follow_link( text => 'Custom Fields' );
     $form = $m->form_number(3);
@@ -130,7 +130,7 @@ diag "check that we see CF as Cc";
     ok $tid, "created ticket";
 
     ok $m->goto_ticket( $tid ), "opened ticket";
-    $m->content_like(qr/$cf_name/, "see CF");
+    $m->content_contains($cf_name, "see CF");
 }
 
 diag "check that owner can see and edit CF";
@@ -140,7 +140,7 @@ diag "check that owner can see and edit CF";
     ok $tid, "created ticket";
 
     ok $m->goto_ticket( $tid ), "opened ticket";
-    $m->content_like(qr/$cf_name/, "see CF");
+    $m->content_contains($cf_name, "see CF");
 
     $m->follow_link( text => 'Custom Fields' );
     my $form = $m->form_number(3);
@@ -155,6 +155,6 @@ diag "check that owner can see and edit CF";
     );
 
     ok $m->goto_ticket( $tid ), "opened ticket";
-    $m->content_like(qr/$cf_name/, "changed cf");
+    $m->content_contains($cf_name, "changed cf");
 }
 
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing.t
index 6d8ca8b..f39e5ee 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing.t
@@ -221,7 +221,7 @@ sub create_a_ticket {
     $m->submit;
     is $m->status, 200, "request successful";
 
-    $m->content_unlike(qr/unable to sign outgoing email messages/);
+    $m->content_lacks("unable to sign outgoing email messages");
 
 
     my @mail = RT::Test->fetch_caught_mails;
@@ -248,7 +248,7 @@ sub update_ticket {
 
     $m->click('SubmitTicket');
     is $m->status, 200, "request successful";
-    $m->content_like(qr/Message recorded/, 'Message recorded') or diag $m->content;
+    $m->content_contains("Message recorded", 'Message recorded') or diag $m->content;
 
 
     my @mail = RT::Test->fetch_caught_mails;
diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t
index 0faed0f..63674d1 100644
--- a/t/mail/gnupg-reverification.t
+++ b/t/mail/gnupg-reverification.t
@@ -80,8 +80,8 @@ foreach my $file ( @files ) {
     is $ticket->Subject, "Test Email ID:$eid", "$eid: correct subject";
 
     $m->goto_ticket( $id );
-    $m->content_like(
-        qr/Not possible to check the signature, the reason is missing public key/is,
+    $m->content_contains(
+        "Not possible to check the signature, the reason is missing public key",
         "$eid: signature is not verified",
     );
     $m->content_like(qr/This is .*ID:$eid/ims, "$eid: content is there and message is decrypted");
@@ -105,8 +105,8 @@ foreach my $id ( @ticket_ids ) {
     diag "testing ticket #$id";
 
     $m->goto_ticket( $id );
-    $m->content_like(
-        qr/The signature is good/is,
+    $m->content_contains(
+        "The signature is good",
         "signature is re-verified and now good",
     );
 
diff --git a/t/ticket/scrips_batch.t b/t/ticket/scrips_batch.t
index 9e733be..b52a26b 100644
--- a/t/ticket/scrips_batch.t
+++ b/t/ticket/scrips_batch.t
@@ -30,7 +30,7 @@ my $sid;
     $m->field('Scrip-new-CustomPrepareCode' => 'return 1;');
     $m->field('Scrip-new-CustomCommitCode' => 'return 1;');
     $m->submit;
-    $m->content_like( qr/Scrip Created/ );
+    $m->content_contains("Scrip Created");
 
     ($sid) = ($m->content =~ /Scrip\s*#(\d+)/);
 
diff --git a/t/web/attachments.t b/t/web/attachments.t
index 0b66bd9..be614c4 100644
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@ -17,7 +17,7 @@ $m->form_name('CreateTicketInQueue');
 $m->field('Queue', $qid);
 $m->submit;
 is($m->status, 200, "request successful");
-$m->content_like(qr/Create a new ticket/, 'ticket create page');
+$m->content_contains("Create a new ticket", 'ticket create page');
 
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Attachments test');
@@ -26,9 +26,9 @@ $m->field('Content', 'Some content');
 $m->submit;
 is($m->status, 200, "request successful");
 
-$m->content_like(qr/Attachments test/, 'we have subject on the page');
-$m->content_like(qr/Some content/, 'and content');
-$m->content_like(qr/Download bpslogo\.png/, 'page has file name');
+$m->content_contains('Attachments test', 'we have subject on the page');
+$m->content_contains('Some content', 'and content');
+$m->content_contains('Download bpslogo.png', 'page has file name');
 
 $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 $m->form_name('TicketUpdate');
@@ -42,6 +42,6 @@ $m->field('UpdateContent', 'Message');
 $m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
-$m->content_like(qr/Download bpslogo\.png/, 'page has file name');
-$m->content_like(qr/Download favicon\.png/, 'page has file name');
+$m->content_contains('Download bpslogo.png', 'page has file name');
+$m->content_contains('Download favicon.png', 'page has file name');
 
diff --git a/t/web/basic.t b/t/web/basic.t
index 00363db..358ba2c 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -22,7 +22,7 @@ my $url = $agent->rt_base_url;
     $agent->login('root' => 'password');
     # the field isn't named, so we have to click link 0
     is( $agent->status, 200, "Fetched the page ok");
-    $agent->content_like(qr/Logout/i, "Found a logout link");
+    $agent->content_contains("Logout", "Found a logout link");
 }
 
 {
@@ -33,7 +33,7 @@ my $url = $agent->rt_base_url;
     $agent->field('Subject' => "Ticket with utf8 body");
     $agent->field('Content' => $string);
     ok($agent->submit, "Created new ticket with $string as Content");
-    $agent->content_like( qr{$string} , "Found the content");
+    $agent->content_contains($string, "Found the content");
     ok($agent->{redirected_uri}, "Did redirection");
 
     {
@@ -55,7 +55,7 @@ my $url = $agent->rt_base_url;
     $agent->field('Subject' => $string);
     $agent->field('Content' => "Ticket with utf8 subject");
     ok($agent->submit, "Created new ticket with $string as Content");
-    $agent->content_like( qr{$string} , "Found the content");
+    $agent->content_contains($string, "Found the content");
     ok($agent->{redirected_uri}, "Did redirection");
 
     {
@@ -74,7 +74,7 @@ my $url = $agent->rt_base_url;
         fields => { TimeWorked => 5, 'TimeWorked-TimeUnits' => "hours" }
     );
 
-    $agent->content_like(qr/to &#39;300&#39;/, "5 hours is 300 minutes");
+    $agent->content_contains("to &#39;300&#39;", "5 hours is 300 minutes");
 }
 
 # {{{ test an image
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index e5f1786..b870914 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -52,7 +52,7 @@ my ( $cf, $cfid, $tid );
     $m->tick( AddCustomField => $_  => 0 ) for @names; # ...and not any other. ;-)
     $m->click('UpdateCFs');
 
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
+    $m->content_contains('Object created', 'TCF added to the queue' );
 }
 
 my $tester = RT::Test->load_or_create_user( Name => 'tester', Password => '123456' );
@@ -70,7 +70,7 @@ diag "check that we have no the CF on the create"
         form_name => "CreateTicketInQueue",
         fields => { Queue => 'General' },
     );
-    $m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
+    $m->content_lacks('Upload multiple images', 'has no upload image field');
 
     my $form = $m->form_name("TicketCreate");
     my $upload_field = "Object-RT::Ticket--CustomField-$cfid-Upload"; 
@@ -82,9 +82,9 @@ diag "check that we have no the CF on the create"
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
 
-    $m->content_unlike(qr/img:/, 'has no img field on the page');
+    $m->content_lacks('img:', 'has no img field on the page');
     $m->follow_link( text => 'Custom Fields');
-    $m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
+    $m->content_lacks('Upload multiple images', 'has no upload image field');
 }
 
 RT::Test->set_rights(
@@ -100,7 +100,7 @@ diag "check that we have no the CF on the create"
         form_name => "CreateTicketInQueue",
         fields => { Queue => 'General' },
     );
-    $m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
+    $m->content_lacks('Upload multiple images', 'has no upload image field');
 
     my $form = $m->form_name("TicketCreate");
     my $upload_field = "Object-RT::Ticket--CustomField-$cfid-Upload";
@@ -114,7 +114,7 @@ diag "check that we have no the CF on the create"
     ok $tid, "a ticket is created succesfully";
 
     $m->follow_link( text => 'Custom Fields' );
-    $m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
+    $m->content_lacks('Upload multiple images', 'has no upload image field');
     $form = $m->form_number(3);
     $upload_field = "Object-RT::Ticket-$tid-CustomField-$cfid-Upload";
     ok !$form->find_input( $upload_field ), 'no form field on the page';
@@ -132,7 +132,7 @@ diag "create a ticket with an image";
         form_name => "CreateTicketInQueue",
         fields => { Queue => 'General' },
     );
-    $m->content_like(qr/Upload multiple images/, 'has a upload image field');
+    $m->content_contains('Upload multiple images', 'has a upload image field');
 
     $cf =~ /(\d+)$/ or die "Hey this is impossible dude";
     my $upload_field = "Object-RT::Ticket--CustomField-$1-Upload";
diff --git a/t/web/cf_date.t b/t/web/cf_date.t
index 25f18fc..37e5cec 100644
--- a/t/web/cf_date.t
+++ b/t/web/cf_date.t
@@ -28,7 +28,7 @@ diag "Create a CF";
             LookupType    => 'RT::Queue-RT::Ticket',
         },
     );
-    $m->content_like( qr/Object created/, 'created CF sucessfully' );
+    $m->content_contains('Object created', 'created CF sucessfully' );
     $cfid = $m->form_name('ModifyCustomField')->value('id');
     ok $cfid, "found id of the CF in the form, it's #$cfid";
 }
@@ -51,7 +51,7 @@ ok $queue && $queue->id, 'loaded or created queue';
     $m->tick( "AddCustomField" => $cfid );
     $m->click('UpdateCFs');
 
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
+    $m->content_contains('Object created', 'TCF added to the queue' );
 }
 
 diag 'check valid inputs with various timezones in ticket create page';
@@ -62,7 +62,7 @@ diag 'check valid inputs with various timezones in ticket create page';
         form_name => "CreateTicketInQueue",
         fields    => { Queue => 'General' },
     );
-    $m->content_like( qr/Select date/, 'has cf field' );
+    $m->content_contains('Select date', 'has cf field' );
 
     $m->submit_form(
         form_name => "TicketCreate",
@@ -79,8 +79,8 @@ diag 'check valid inputs with various timezones in ticket create page';
     is( $ticket->CustomFieldValues($cfid)->First->Content,
         '2010-05-04', 'date in db' );
 
-    $m->content_like( qr/test cf date:/, 'has no cf date field on the page' );
-    $m->content_like( qr/Tue May 04 2010/,
+    $m->content_contains('test cf date:', 'has no cf date field on the page' );
+    $m->content_contains('Tue May 04 2010',
         'has cf date value on the page' );
 }
 
@@ -186,6 +186,6 @@ diag 'check invalid inputs';
     $m->content_like( qr/Ticket \d+ created/,
         "a ticket is created succesfully" );
 
-    $m->content_like( qr/test cf date:/, 'has no cf date field on the page' );
-    $m->content_unlike( qr/foodate/, 'invalid dates not set' );
+    $m->content_contains('test cf date:', 'has no cf date field on the page' );
+    $m->content_lacks('foodate', 'invalid dates not set' );
 }
diff --git a/t/web/cf_datetime.t b/t/web/cf_datetime.t
index af7d2b0..3c253f7 100644
--- a/t/web/cf_datetime.t
+++ b/t/web/cf_datetime.t
@@ -29,7 +29,7 @@ diag "Create a CF";
             LookupType    => 'RT::Queue-RT::Ticket',
         },
     );
-    $m->content_like( qr/Object created/, 'created CF sucessfully' );
+    $m->content_contains('Object created', 'created CF sucessfully' );
     $cfid = $m->form_name('ModifyCustomField')->value('id');
     ok $cfid, "found id of the CF in the form, it's #$cfid";
 }
@@ -50,7 +50,7 @@ ok $queue && $queue->id, 'loaded or created queue';
     $m->tick( "AddCustomField" => $cfid );
     $m->click('UpdateCFs');
 
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
+    $m->content_contains('Object created', 'TCF added to the queue' );
 }
 
 diag 'check valid inputs with various timezones in ticket create page';
@@ -61,7 +61,7 @@ diag 'check valid inputs with various timezones in ticket create page';
         form_name => "CreateTicketInQueue",
         fields => { Queue => 'General' },
     );
-    $m->content_like(qr/Select datetime/, 'has cf field');
+    $m->content_contains('Select datetime', 'has cf field');
 
     $m->submit_form(
         form_name => "TicketCreate",
@@ -82,13 +82,13 @@ diag 'check valid inputs with various timezones in ticket create page';
         'date in db is in UTC'
     );
 
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_like(qr/Tue May 04 13:00:01 2010/, 'has cf datetime value on the page');
+    $m->content_contains('test cf datetime:', 'has no cf datetime field on the page');
+    $m->content_contains('Tue May 04 13:00:01 2010', 'has cf datetime value on the page');
 
     $root->SetTimezone( 'Asia/Shanghai' );
     # interesting that $m->reload doesn't work
     $m->get_ok( $m->uri );
-    $m->content_like(qr/Wed May 05 01:00:01 2010/, 'cf datetime value respects user timezone');
+    $m->content_contains('Wed May 05 01:00:01 2010', 'cf datetime value respects user timezone');
 
     $m->submit_form(
         form_name => "CreateTicketInQueue",
@@ -112,11 +112,11 @@ diag 'check valid inputs with various timezones in ticket create page';
         'date in db is in UTC'
     );
 
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_like(qr/Thu May 06 07:00:01 2010/, 'cf datetime input respects user timezone');
+    $m->content_contains('test cf datetime:', 'has no cf datetime field on the page');
+    $m->content_contains('Thu May 06 07:00:01 2010', 'cf datetime input respects user timezone');
     $root->SetTimezone( 'EST5EDT' ); # back to -04:00
     $m->get_ok( $m->uri );
-    $m->content_like(qr/Wed May 05 19:00:01 2010/, 'cf datetime value respects user timezone');
+    $m->content_contains('Wed May 05 19:00:01 2010', 'cf datetime value respects user timezone');
 }
 
 
@@ -232,6 +232,6 @@ diag 'check invalid inputs';
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
 
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_unlike(qr/foodate/, 'invalid dates not set');
+    $m->content_contains('test cf datetime:', 'has no cf datetime field on the page');
+    $m->content_lacks('foodate', 'invalid dates not set');
 }
diff --git a/t/web/cf_onqueue.t b/t/web/cf_onqueue.t
index e4be2e3..86eaa4d 100644
--- a/t/web/cf_onqueue.t
+++ b/t/web/cf_onqueue.t
@@ -22,7 +22,7 @@ diag "Create a queue CF";
             Description => 'QueueCFTest',
         },
     );
-    $m->content_like( qr/Object created/, 'CF QueueCFTest created' );
+    $m->content_contains('Object created', 'CF QueueCFTest created' );
 }
 
 diag "Apply the new CF globally";
@@ -33,13 +33,13 @@ diag "Apply the new CF globally";
     $m->title_is(q/Global custom field configuration/, 'global custom field configuration screen');
     $m->follow_link( url => 'Queues.html' );
     $m->title_is(q/Edit Custom Fields for all queues/, 'global custom field for all queues configuration screen');
-    $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on page' );
+    $m->content_contains('QueueCFTest', 'CF QueueCFTest displayed on page' );
 
     $m->form_name('EditCustomFields');
     $m->tick( AddCustomField => 1 );
     $m->click('UpdateCFs');
 
-    $m->content_like( qr/Object created/, 'CF QueueCFTest enabled globally' );
+    $m->content_contains('Object created', 'CF QueueCFTest enabled globally' );
 }
 
 diag "Edit the CF value for default queue";
@@ -48,7 +48,7 @@ diag "Edit the CF value for default queue";
     $m->title_is(q/Admin queues/, 'queues configuration screen');
     $m->follow_link( text => "1" );
     $m->title_is(q/Editing Configuration for queue General/, 'default queue configuration screen');
-    $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on default queue' );
+    $m->content_contains('QueueCFTest', 'CF QueueCFTest displayed on default queue' );
     $m->submit_form(
         form_number => 3,
         # The following doesn't want to works :(
@@ -57,7 +57,7 @@ diag "Edit the CF value for default queue";
             'Object-RT::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
         },
     );
-    $m->content_like( qr/QueueCFTest QueueCFTest content added/, 'Content filed in CF QueueCFTest for default queue' );
+    $m->content_contains('QueueCFTest QueueCFTest content added', 'Content filed in CF QueueCFTest for default queue' );
 
 }
 
diff --git a/t/web/cf_select_one.t b/t/web/cf_select_one.t
index aa96c17..523c4db 100644
--- a/t/web/cf_select_one.t
+++ b/t/web/cf_select_one.t
@@ -26,7 +26,7 @@ diag "Create a CF";
             LookupType    => 'RT::Queue-RT::Ticket',
         },
     );
-    $m->content_like( qr/Object created/, 'created CF sucessfully' );
+    $m->content_contains('Object created', 'created CF sucessfully' );
     $cfid = $m->form_name('ModifyCustomField')->value('id');
     ok $cfid, "found id of the CF in the form, it's #$cfid";
 }
@@ -41,11 +41,11 @@ diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF";
             },
             button => 'Update',
         );
-        $m->content_like( qr/Object created/, 'added a value to the CF' ); # or diag $m->content;
+        $m->content_contains('Object created', 'added a value to the CF' ); # or diag $m->content;
         my $v = $value;
         $v =~ s/^\s+$//;
         $v =~ s/\s+$//;
-        $m->content_like( qr/value="$v"/, 'the added value is right' );
+        $m->content_contains("value=\"$v\"", 'the added value is right' );
     }
 }
 
@@ -65,7 +65,7 @@ diag "apply the CF to General queue";
     $m->tick( "AddCustomField" => $cfid );
     $m->click('UpdateCFs');
 
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
+    $m->content_contains('Object created', 'TCF added to the queue' );
 }
 
 my $tid;
@@ -93,7 +93,7 @@ diag "check that values of the CF are case insensetive(asd vs. ASD)";
     ok $m->goto_ticket( $tid ), "opened ticket's page";
     $m->follow_link( text => 'Custom Fields' );
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
-    $m->content_like(qr/\Q$cf_name/, 'CF on the page');
+    $m->content_contains($cf_name, 'CF on the page');
 
     my $value = $m->form_number(3)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
     is lc $value, 'asd', 'correct value is selected';
@@ -115,14 +115,14 @@ diag "check that 0 is ok value of the CF";
     ok $m->goto_ticket( $tid ), "opened ticket's page";
     $m->follow_link( text => 'Custom Fields' );
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
-    $m->content_like(qr/\Q$cf_name/, 'CF on the page');
+    $m->content_contains($cf_name, 'CF on the page');
 
     my $value = $m->form_number(3)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
     is lc $value, 'asd', 'correct value is selected';
     $m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => 0 );
     $m->submit;
     $m->content_like(qr/\Q$cf_name\E.*?changed/mi, 'field is changed');
-    $m->content_unlike(qr/0 is no longer a value for custom field/mi, 'no bad message in results');
+    $m->content_lacks('0 is no longer a value for custom field', 'no bad message in results');
 
     $value = $m->form_number(3)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
     is lc $value, '0', 'new value is selected';
@@ -139,13 +139,13 @@ diag "check that we can set empty value when the current is 0";
     ok $m->goto_ticket( $tid ), "opened ticket's page";
     $m->follow_link( text => 'Custom Fields' );
     $m->title_like(qr/Modify ticket/i, 'modify ticket');
-    $m->content_like(qr/\Q$cf_name/, 'CF on the page');
+    $m->content_contains($cf_name, 'CF on the page');
 
     my $value = $m->form_number(3)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
     is lc $value, '0', 'correct value is selected';
     $m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => '' );
     $m->submit;
-    $m->content_like(qr/0 is no longer a value for custom field/mi, '0 is no longer a value');
+    $m->content_contains('0 is no longer a value for custom field', '0 is no longer a value');
 
     $value = $m->form_number(3)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
     is $value, '', '(no value) is selected';
diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index fdf4cd1..5789ff8 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -35,7 +35,7 @@ is($agent->status, 200, "Loaded a page");
 # follow the link marked "Login"
 $agent->login(root => 'password');
 is($agent->status, 200, "Fetched the page ok");
-$agent->content_like(qr/Logout/i, "Found a logout link");
+$agent->content_contains('Logout', "Found a logout link");
 
 
 find ( sub { wanted() and test_get($File::Find::name) } , 'share/html/');
@@ -53,8 +53,8 @@ sub test_get {
 
         $agent->get_ok("$url/$file");
         is($agent->status, 200, "Loaded $file");
-        $agent->content_unlike(qr/Not logged in/i, "Still logged in for  $file");
-        $agent->content_unlike(qr/raw error/i, "Didn't get a Mason compilation error on $file") or do {
+        $agent->content_lacks('Not logged in', "Still logged in for  $file");
+        $agent->content_lacks('raw error', "Didn't get a Mason compilation error on $file") or do {
             if (my ($error) = $agent->content =~ /<pre>(.*)/) {
                 diag "$file: $error";
             }
diff --git a/t/web/config_tab_right.t b/t/web/config_tab_right.t
index d7f4cbf..3632c5c 100644
--- a/t/web/config_tab_right.t
+++ b/t/web/config_tab_right.t
@@ -20,7 +20,7 @@ my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login($uname, $upass), "logged in";
 
 {
-    $m->content_unlike(qr/Configuration/, 'no configuration');
+    $m->content_lacks('Configuration', 'no configuration tab');
     $m->get('/Admin/');
     is $m->status, 403, 'no access to /Admin/';
 }
@@ -33,7 +33,7 @@ RT::Test->set_rights(
 
 {
     $m->get('/');
-    $m->content_like(qr/Configuration/, 'configuration is there');
+    $m->content_contains('Configuration', 'configuration tab is there');
 
     $m->follow_link_ok({text => 'Configuration'});
     is $m->status, 200, 'user has access to /Admin/';
diff --git a/t/web/custom_frontpage.t b/t/web/custom_frontpage.t
index a1cd11a..085e907 100644
--- a/t/web/custom_frontpage.t
+++ b/t/web/custom_frontpage.t
@@ -29,7 +29,7 @@ $m->field ( "SavedSearchDescription" => 'stupid tickets');
 $m->click_button (name => 'SavedSearchSave');
 
 $m->get ( $url.'Prefs/MyRT.html' );
-$m->content_like (qr/stupid tickets/, 'saved search listed in rt at a glance items');
+$m->content_contains('stupid tickets', 'saved search listed in rt at a glance items');
 
 ok $m->login('root', 'password', logout => 1), 'we did log in as root';
 
@@ -58,4 +58,4 @@ $m->click_button (name => 'movedown');
 $m->form_name ('SelectionBox-body');
 #$m->click_button (name => 'body-Save');
 $m->get ( $url );
-$m->content_like (qr'highest priority tickets', 'adds them back');
+$m->content_contains('highest priority tickets', 'adds them back');
diff --git a/t/web/custom_search.t b/t/web/custom_search.t
index 05cfdab..c1c79db 100644
--- a/t/web/custom_search.t
+++ b/t/web/custom_search.t
@@ -24,7 +24,7 @@ $m->get ( $url.'Prefs/MyRT.html' );
 my $cus_hp = $m->find_link( text => "My Tickets" );
 my $cus_qs = $m->find_link( text => "Quick search" );
 $m->get ($cus_hp);
-$m->content_like (qr'highest priority tickets');
+$m->content_contains('highest priority tickets');
 
 # add Requestor to the fields
 $m->form_name ('BuildQuery');
diff --git a/t/web/dashboard_with_deleted_saved_search.t b/t/web/dashboard_with_deleted_saved_search.t
index 328095a..a7225ce 100644
--- a/t/web/dashboard_with_deleted_saved_search.t
+++ b/t/web/dashboard_with_deleted_saved_search.t
@@ -38,7 +38,7 @@ $m->submit_form(
     fields    => { Name => 'bar' },
 );
 
-$m->content_like( qr/Saved dashboard bar/i, 'dashboard saved' );
+$m->content_contains('Saved dashboard bar', 'dashboard saved' );
 my $dashboard_queries_link = $m->find_link( text_regex => qr/Queries/ );
 my ( $dashboard_id ) = $dashboard_queries_link->url =~ /id=(\d+)/;
 
@@ -53,7 +53,7 @@ $m->submit_form(
     button => 'add',
 );
 
-$m->content_like( qr/Dashboard updated/i, 'added search foo to dashboard bar' );
+$m->content_contains('Dashboard updated', 'added search foo to dashboard bar' );
 
 # delete the created search
 
@@ -72,7 +72,7 @@ $m->content_lacks( $search_uri, 'deleted search foo' );
 # here is what we really want to test
 
 $m->get_ok( $url . "/Dashboards/Queries.html?id=$dashboard_id" );
-$m->content_like( qr/Deleted queries/i, 'found deleted message' );
+$m->content_contains('Deleted queries', 'found deleted message' );
 
 # Update button shows so we can update the deleted search easily
 $m->content_contains( 'value="Update"', 'found update button' );
@@ -82,7 +82,7 @@ $m->submit_form(
     button    => 'update',
 );
 
-$m->content_unlike( qr/Deleted queries/i, 'deleted message is gone' );
+$m->content_lacks('Deleted queries', 'deleted message is gone' );
 $m->content_lacks( 'value="Update"', 'update button is gone too' );
 
 $m->get_warnings; # we'll get a lot of warnings because the deleted search
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index 5777d1b..28bc6ce 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -55,8 +55,8 @@ diag "check that signing doesn't work if there is no key";
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/unable to sign outgoing email messages/i,
+    $m->content_contains(
+        'unable to sign outgoing email messages',
         'problems with passphrase'
     );
     $m->warning_like(qr/signing failed: secret key not available/);
@@ -82,12 +82,12 @@ diag "check that things don't work if there is no key";
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There is no key suitable for encryption/i,
+    $m->content_contains(
+        'There is no key suitable for encryption',
         'problems with keys'
     );
 
@@ -120,12 +120,12 @@ diag "check that things still doesn't work if key is not trusted";
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There is one suitable key, but trust level is not set/i,
+    $m->content_contains(
+        'There is one suitable key, but trust level is not set',
         'problems with keys'
     );
 
@@ -135,12 +135,12 @@ diag "check that things still doesn't work if key is not trusted";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/Selected key either is not trusted/i,
+    $m->content_contains(
+        'Selected key either is not trusted',
         'problems with keys'
     );
 
@@ -169,12 +169,12 @@ diag "check that things still doesn't work if two keys are not trusted";
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -184,12 +184,12 @@ diag "check that things still doesn't work if two keys are not trusted";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/Selected key either is not trusted/i,
+    $m->content_contains(
+        'Selected key either is not trusted',
         'problems with keys'
     );
 
@@ -216,12 +216,12 @@ diag "check that we see key selector even if only one key is trusted but there a
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -245,12 +245,12 @@ diag "check that key selector works and we can select trusted key";
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -280,12 +280,12 @@ diag "check encrypting of attachments";
     $m->field( Content => 'Some content' );
     $m->field( Attach => $0 );
     $m->submit;
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index ab99170..c03ac3c 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -67,8 +67,8 @@ diag "check that signing doesn't work if there is no key";
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/unable to sign outgoing email messages/i,
+    $m->content_contains(
+        'unable to sign outgoing email messages',
         'problems with passphrase'
     );
 
@@ -97,12 +97,12 @@ diag "check that things don't work if there is no key";
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There is no key suitable for encryption/i,
+    $m->content_contains(
+        'There is no key suitable for encryption',
         'problems with keys'
     );
 
@@ -137,12 +137,12 @@ diag "check that things still doesn't work if key is not trusted";
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There is one suitable key, but trust level is not set/i,
+    $m->content_contains(
+        'There is one suitable key, but trust level is not set',
         'problems with keys'
     );
 
@@ -152,12 +152,12 @@ diag "check that things still doesn't work if key is not trusted";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/Selected key either is not trusted/i,
+    $m->content_contains(
+        'Selected key either is not trusted',
         'problems with keys'
     );
 
@@ -187,12 +187,12 @@ diag "check that things still doesn't work if two keys are not trusted";
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -202,12 +202,12 @@ diag "check that things still doesn't work if two keys are not trusted";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/Selected key either is not trusted/i,
+    $m->content_contains(
+        'Selected key either is not trusted',
         'problems with keys'
     );
 
@@ -235,12 +235,12 @@ diag "check that we see key selector even if only one key is trusted but there a
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -265,12 +265,12 @@ diag "check that key selector works and we can select trusted key";
     $m->field( UpdateCc => 'rt-test at example.com' );
     $m->field( UpdateContent => 'Some content' );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -280,7 +280,7 @@ diag "check that key selector works and we can select trusted key";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->click('SubmitTicket');
-    $m->content_like( qr/Message recorded/i, 'Message recorded' );
+    $m->content_contains('Message recorded', 'Message recorded' );
 
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
@@ -301,12 +301,12 @@ diag "check encrypting of attachments";
     $m->field( UpdateContent => 'Some content' );
     $m->field( Attach => $0 );
     $m->click('SubmitTicket');
-    $m->content_like(
-        qr/You are going to encrypt outgoing email messages/i,
+    $m->content_contains(
+        'You are going to encrypt outgoing email messages',
         'problems with keys'
     );
-    $m->content_like(
-        qr/There are several keys suitable for encryption/i,
+    $m->content_contains(
+        'There are several keys suitable for encryption',
         'problems with keys'
     );
 
@@ -316,7 +316,7 @@ diag "check encrypting of attachments";
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
     $m->click('SubmitTicket');
-    $m->content_like( qr/Message recorded/i, 'Message recorded' );
+    $m->content_contains('Message recorded', 'Message recorded' );
 
     my @mail = RT::Test->fetch_caught_mails;
     ok @mail, 'there are some emails';
diff --git a/t/web/gnupg-tickyboxes.t b/t/web/gnupg-tickyboxes.t
index afbdc35..ba5ac5e 100644
--- a/t/web/gnupg-tickyboxes.t
+++ b/t/web/gnupg-tickyboxes.t
@@ -131,7 +131,7 @@ sub create_a_ticket {
     $m->submit;
     is $m->status, 200, "request successful";
 
-    $m->content_unlike(qr/unable to sign outgoing email messages/);
+    $m->content_lacks('unable to sign outgoing email messages');
 
     $m->get_ok('/'); # ensure that the mail has been processed
 
diff --git a/t/web/query_builder.t b/t/web/query_builder.t
index bb38a8b..a3747eb 100644
--- a/t/web/query_builder.t
+++ b/t/web/query_builder.t
@@ -116,7 +116,7 @@ diag "Can not move up the top most clause";
     $agent->select("clauses", ["0"]);
     $agent->click("Up");
     ok $agent->form_name('BuildQuery'), "found the form again";
-    $agent->content_like(qr/error: can\S+t move up/, "i shouldn't have been able to hit up");
+    $agent->content_contains("error: can&#39;t move up", "i shouldn't have been able to hit up");
     is_deeply selectedClauses, ["0"], 'the one we tried to move is selected';
 }
 
@@ -124,7 +124,7 @@ diag "Can not move left the left most clause";
 {
     $agent->click("Left");
     ok($agent->form_name('BuildQuery'), "found the form again");
-    $agent->content_like(qr/error: can\S+t move left/, "i shouldn't have been able to hit left");
+    $agent->content_contains("error: can&#39;t move left", "i shouldn't have been able to hit left");
     is_deeply selectedClauses, ["0"], 'the one we tried to move is selected';
 }
 
diff --git a/t/web/rights1.t b/t/web/rights1.t
index 57c23f2..d61a125 100644
--- a/t/web/rights1.t
+++ b/t/web/rights1.t
@@ -42,7 +42,7 @@ ok($grantid,$grantmsg);
 
 $agent->reload;
 
-$agent->content_like(qr/Logout/i, "Reloaded page successfully");
+$agent->content_contains('Logout', "Reloaded page successfully");
 ok($agent->find_link( url => "$RT::WebPath/Admin/",
 		       text => 'Configuration'), "Found config tab" );
 my ($revokeid,$revokemsg) =$user_obj->PrincipalObj->RevokeRight(Right => 'ShowConfigTab');
@@ -50,7 +50,7 @@ ok ($revokeid,$revokemsg);
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
 ok ($grantid,$grantmsg);
 $agent->reload();
-$agent->content_like(qr/Logout/i, "Reloaded page successfully");
+$agent->content_contains('Logout', "Reloaded page successfully");
 ok($agent->find_link( 
 		       text => 'Preferences'), "Found prefs pane" );
 ($revokeid,$revokemsg) = $user_obj->PrincipalObj->RevokeRight(Right => 'ModifySelf');
@@ -59,21 +59,20 @@ ok ($revokeid,$revokemsg);
 $agent->follow_link( url => "$RT::WebPath/Search/Build.html",
 		     text => 'Tickets');
 is($agent->status, 200, "Fetched search builder page");
-$agent->content_unlike(qr/Load saved search/i, "No search loading box");
-$agent->content_unlike(qr/Saved searches/i, "No saved searches box");
+$agent->content_lacks("Load saved search", "No search loading box");
+$agent->content_lacks("Saved searches", "No saved searches box");
 
 ($grantid,$grantmsg) = $user_obj->PrincipalObj->GrantRight(Right => 'LoadSavedSearch');
 ok($grantid,$grantmsg);
 $agent->reload();
-$agent->content_like(qr/Load saved search/i, "Search loading box exists");
+$agent->content_contains("Load saved search", "Search loading box exists");
 $agent->content_unlike(qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i,
    "Still no saved searches box");
 
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'CreateSavedSearch');
 ok ($grantid,$grantmsg);
 $agent->reload();
-$agent->content_like(qr/Load saved search/i,
-   "Search loading box still exists");
+$agent->content_contains("Load saved search", "Search loading box still exists");
 $agent->content_like(qr/input\s+type=['"]submit['"][^>]+name=['"]SavedSearchSave['"]/i,
    "Saved searches box exists");
 
diff --git a/t/web/saved_search_chart.t b/t/web/saved_search_chart.t
index 1051662..d3a36aa 100644
--- a/t/web/saved_search_chart.t
+++ b/t/web/saved_search_chart.t
@@ -35,7 +35,7 @@ $m->submit_form(
     button => 'SavedSearchSave',
 );
 
-$m->content_like( qr/Chart first chart saved/, 'saved first chart' );
+$m->content_contains("Chart first chart saved", 'saved first chart' );
 
 my ( $search_uri, $id ) = $m->content =~ /value="(RT::User-\d+-SavedSearch-(\d+))"/;
 $m->submit_form(
@@ -64,8 +64,8 @@ $m->submit_form(
     button => 'SavedSearchSave',
 );
 
-$m->content_like( qr/Chart first chart updated/, 'found updated message' );
-$m->content_like( qr/id=2/,                      'Query is updated' );
+$m->content_contains("Chart first chart updated", 'found updated message' );
+$m->content_contains("id=2",                      'Query is updated' );
 $m->content_like( qr/value="Status"\s+selected="selected"/,
     'PrimaryGroupBy is updated' );
 $m->content_like( qr/value="pie"\s+selected="selected"/,
@@ -81,6 +81,6 @@ $m->submit_form(
     form_name => 'SaveSearch',
     button    => 'SavedSearchDelete',
 );
-$m->content_like( qr/Chart first chart deleted/, 'found deleted message' );
+$m->content_contains("Chart first chart deleted", 'found deleted message' );
 $m->content_unlike( qr/value="RT::User-\d+-SavedSearch-\d+"/,
     'no saved search' );
diff --git a/t/web/ticket-create-utf8.t b/t/web/ticket-create-utf8.t
index f37eeec..461ebb8 100644
--- a/t/web/ticket-create-utf8.t
+++ b/t/web/ticket-create-utf8.t
@@ -58,8 +58,8 @@ foreach my $test_str ( $ru_test, $l1_test ) {
             qr{<td\s+class="message-header-value"[^>]*>\s*\Q$test_str\E\s*</td>}i,
             'header on the page'
         );
-        $m->content_like( 
-            qr{\Q$support_str\E}i,
+        $m->content_contains(
+            $support_str,
             'content on the page'
         );
 
@@ -81,8 +81,8 @@ foreach my $test_str ( $ru_test, $l1_test ) {
             qr{<td\s+class="message-header-value"[^>]*>\s*\Q$test_str\E\s*</td>}i,
             'header on the page'
         );
-        $m->content_like( 
-            qr{\Q$support_str\E}i,
+        $m->content_contains(
+            $support_str,
             'content on the page'
         );
 
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index d018ec1..166f383 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -35,7 +35,7 @@ diag "current user has no right to own, nobody selected as owner on create";
     $agent_a->select( 'Queue', $queue->id );
     $agent_a->submit;
 
-    $agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
+    $agent_a->content_contains('Create a new ticket', 'opened create ticket page');
     my $form = $agent_a->form_name('TicketCreate');
     is $form->value('Owner'), $RT::Nobody->id, 'correct owner selected';
     ok !grep($_ == $user_a->id, $form->find_input('Owner')->possible_values),
@@ -59,7 +59,7 @@ diag "user can chose owner of a new ticket";
     $agent_a->select( 'Queue', $queue->id );
     $agent_a->submit;
 
-    $agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
+    $agent_a->content_contains('Create a new ticket', 'opened create ticket page');
     my $form = $agent_a->form_name('TicketCreate');
     is $form->value('Owner'), $RT::Nobody->id, 'correct owner selected';
 
@@ -101,8 +101,8 @@ diag "user A can not change owner after create";
         $agent->select('Owner', $RT::Nobody->id);
         $agent->submit;
 
-        $agent->content_like(
-            qr/Permission denied/i,
+        $agent->content_contains(
+            'Permission Denied',
             'no way to change owner after create if you have no rights'
         );
 
diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 07f90f2..62eaea5 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -37,7 +37,7 @@ diag "current user has no right to own, nobody selected as owner on create";
     $agent_a->select( 'Queue', $queue->id );
     $agent_a->submit;
 
-    $agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
+    $agent_a->content_contains('Create a new ticket', 'opened create ticket page');
     my $form = $agent_a->form_name('TicketCreate');
     is $form->value('Owner'), $RT::Nobody->Name, 'correct owner selected';
     autocomplete_lacks( 'RT::Queue-'.$queue->id, 'user_a' );
@@ -60,7 +60,7 @@ diag "user can chose owner of a new ticket";
     $agent_a->select( 'Queue', $queue->id );
     $agent_a->submit;
 
-    $agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
+    $agent_a->content_contains('Create a new ticket', 'opened create ticket page');
     my $form = $agent_a->form_name('TicketCreate');
     is $form->value('Owner'), $RT::Nobody->Name, 'correct owner selected';
 
@@ -101,8 +101,8 @@ diag "user A can not change owner after create";
         $form->value('Owner', $RT::Nobody->Name);
         $agent->submit;
 
-        $agent->content_like(
-            qr/Permission denied/i,
+        $agent->content_contains(
+            'Permission Denied',
             'no way to change owner after create if you have no rights'
         );
 
diff --git a/t/web/ticket_seen.t b/t/web/ticket_seen.t
index a285c6a..6d8c5f4 100644
--- a/t/web/ticket_seen.t
+++ b/t/web/ticket_seen.t
@@ -62,10 +62,10 @@ diag "user B adds a message, we check that user A see notification and can clear
     ok( $reply_id, 'got correspond txn id' );
 
     $agent_a->goto_ticket($tid);
-    $agent_a->content_like(qr/bla-bla/ims, 'the message on the page');
+    $agent_a->content_contains('bla-bla', 'the message on the page');
 
-    $agent_a->content_like(
-        qr/unread message/ims,
+    $agent_a->content_contains(
+        'unread message',
         'we have not seen something'
     );
 
@@ -76,20 +76,20 @@ diag "user B adds a message, we check that user A see notification and can clear
     like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' );
 
     $agent_a->follow_link_ok({text => 'jump to the first unread message and mark all messages as seen'}, 'try to mark all as seen');
-    $agent_a->content_like(
-        qr/Marked all messages as seen/ims,
+    $agent_a->content_contains(
+        'Marked all messages as seen',
         'see success message'
     );
     like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' );
 
-    $agent_a->content_like(
-        qr/Marked all messages as seen/ims,
+    $agent_a->content_contains(
+        'Marked all messages as seen',
         'see success message'
     );
 
     $agent_a->goto_ticket($tid);
-    $agent_a->content_unlike(
-        qr/unread message/ims,
+    $agent_a->content_lacks(
+        'unread message',
         'we have seen everything, so no messages'
     );
 }
diff --git a/t/web/ticket_txn_content.t b/t/web/ticket_txn_content.t
index 1c1056a..dfed711 100644
--- a/t/web/ticket_txn_content.t
+++ b/t/web/ticket_txn_content.t
@@ -31,7 +31,7 @@ for my $type ( 'text/plain', 'text/html' ) {
     $m->field( 'Queue', $qid );
     $m->submit;
     is( $m->status, 200, "request successful" );
-    $m->content_like( qr/Create a new ticket/, 'ticket create page' );
+    $m->content_contains('Create a new ticket', 'ticket create page' );
 
     $m->form_name('TicketCreate');
     $m->field( 'Subject', 'with plain attachment' );
@@ -40,16 +40,16 @@ for my $type ( 'text/plain', 'text/html' ) {
     $m->field( 'ContentType', $type ) unless $type eq 'text/plain';
     $m->submit;
     is( $m->status, 200, "request successful" );
-    $m->content_like( qr/with plain attachment/,
+    $m->content_contains('with plain attachment',
         'we have subject on the page' );
-    $m->content_like( qr/this is main content/, 'main content' );
-    $m->content_like( qr/Download $plain_name/, 'download plain file link' );
+    $m->content_contains('this is main content', 'main content' );
+    $m->content_contains("Download $plain_name", 'download plain file link' );
 
     my ( $mail ) = RT::Test->fetch_caught_mails;
     like( $mail, qr/this is main content/, 'email contains main content' );
     # check the email link in page too
     $m->follow_link_ok( { text => 'Show' }, 'show the email outgoing' );
-    $m->content_like( qr/this is main content/, 'email contains main content');
+    $m->content_contains('this is main content', 'email contains main content');
     $m->back;
 
     $m->follow_link_ok( { text => 'Reply' }, "reply to the ticket" );
@@ -67,13 +67,13 @@ for my $type ( 'text/plain', 'text/html' ) {
     $m->click('SubmitTicket');
     is( $m->status, 200, "request successful" );
 
-    $m->content_like( qr/this is main reply content/, 'main reply content' );
-    $m->content_like( qr/Download $html_name/, 'download html file link' );
+    $m->content_contains("this is main reply content", 'main reply content' );
+    $m->content_contains("Download $html_name", 'download html file link' );
 
     ( $mail ) = RT::Test->fetch_caught_mails;
     like( $mail, qr/this is main reply content/, 'email contains main reply content' );
     # check the email link in page too
     $m->follow_link_ok( { text => 'Show', n => 2 }, 'show the email outgoing' );
-    $m->content_like( qr/this is main reply content/, 'email contains main reply content');
+    $m->content_contains("this is main reply content", 'email contains main reply content');
     $m->back;
 }
diff --git a/t/web/ticket_update_without_content.t b/t/web/ticket_update_without_content.t
index 595cb74..b7631db 100644
--- a/t/web/ticket_update_without_content.t
+++ b/t/web/ticket_update_without_content.t
@@ -30,8 +30,8 @@ $m->submit_form(
     fields      => { Priority => '1', }
 );
 
-$m->content_like(qr/priority changed/i);
-$m->content_unlike(qr/message recorded/i);
+$m->content_contains("Priority changed");
+$m->content_lacks("message recorded");
 
 my $root = RT::User->new( $RT::SystemUser );
 $root->Load('root');
@@ -48,5 +48,5 @@ $m->submit_form(
     form_number => 3,
     fields      => { Priority => '2', }
 );
-$m->content_like(qr/priority changed/i);
-$m->content_unlike(qr/message recorded/i);
+$m->content_contains("Priority changed");
+$m->content_lacks("message recorded");
diff --git a/t/web/unlimited_search.t b/t/web/unlimited_search.t
index d98baaa..168ee43 100644
--- a/t/web/unlimited_search.t
+++ b/t/web/unlimited_search.t
@@ -27,7 +27,7 @@ $agent->form_name('BuildQuery');
 $agent->field('RowsPerPage', '0');
 $agent->submit('DoSearch');
 $agent->follow_link_ok({text=>'Show Results'});
-$agent->content_like(qr/Ticket 75/);
+$agent->content_contains("Ticket 75");
 
 $agent->follow_link_ok({text=>'New Search'});
 $agent->form_name('BuildQuery');
@@ -38,4 +38,4 @@ $agent->form_name('BuildQuery');
 $agent->field('RowsPerPage', '50');
 $agent->submit('DoSearch');
 $agent->follow_link_ok({text=>'Bulk Update'});
-$agent->content_unlike(qr/Ticket 51/);
+$agent->content_lacks("Ticket 51");

commit 0eeabf64cd4f9d0b062150cb97491ee93b9ff331
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 15:26:23 2010 -0400

    Test each ticket creation in unlimited_search.t

diff --git a/t/web/unlimited_search.t b/t/web/unlimited_search.t
index 168ee43..f7cab4d 100644
--- a/t/web/unlimited_search.t
+++ b/t/web/unlimited_search.t
@@ -2,12 +2,12 @@
 
 use strict;
 
-use RT::Test tests => 8;
+use RT::Test tests => 83;
 RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new($RT::SystemUser);
 for ( 1 .. 75 ) {
-    $ticket->Create(
+    ok $ticket->Create(
         Subject   => 'Ticket ' . $_,
         Queue     => 'General',
         Owner     => 'root',

commit 30dd8b0a091461302c70bf98d49b56ac88c87cc3
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 15:29:07 2010 -0400

    Use the agent started_ok constructs instead of throwing it away and making a new one

diff --git a/t/web/search_rss.t b/t/web/search_rss.t
index 4813963..f339c60 100644
--- a/t/web/search_rss.t
+++ b/t/web/search_rss.t
@@ -3,7 +3,7 @@
 use strict;
 
 use RT::Test tests => 36;
-RT::Test->started_ok;
+my ($baseurl, $agent) = RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new($RT::SystemUser);
 for ( 1 .. 5 ) {
@@ -15,7 +15,6 @@ for ( 1 .. 5 ) {
     );
 }
 
-my $agent = RT::Test::Web->new;
 ok $agent->login('root', 'password'), 'logged in as root';
 
 $agent->get_ok('/Search/Build.html');
diff --git a/t/web/template.t b/t/web/template.t
index 8b06f53..50c93e3 100644
--- a/t/web/template.t
+++ b/t/web/template.t
@@ -9,13 +9,12 @@ my $user_a = RT::Test->load_or_create_user(
 );
 ok $user_a && $user_a->id, 'loaded or created user';
 
-RT::Test->started_ok;
+my ($baseurl, $m) = RT::Test->started_ok;
 
 ok( RT::Test->set_rights(
     { Principal => $user_a, Right => [qw(ShowConfigTab ShowTemplate ModifyTemplate)] },
 ), 'set rights');
 
-my $m = RT::Test::Web->new;
 ok $m->login('user_a', 'password'), 'logged in as user A';
 
 # get to the templates screen
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index 166f383..4578184 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -18,14 +18,13 @@ my $user_b = RT::Test->load_or_create_user(
 );
 ok $user_b && $user_b->id, 'loaded or created user';
 
-RT::Test->started_ok;
+my ($baseurl, $agent_a) = RT::Test->started_ok;
 
 ok( RT::Test->set_rights(
     { Principal => $user_a, Right => [qw(SeeQueue ShowTicket CreateTicket ReplyToTicket)] },
     { Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
 ), 'set rights');
 
-my $agent_a = RT::Test::Web->new;
 ok $agent_a->login('user_a', 'password'), 'logged in as user A';
 
 diag "current user has no right to own, nobody selected as owner on create";
diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 62eaea5..d3cb600 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -20,14 +20,13 @@ my $user_b = RT::Test->load_or_create_user(
 ok $user_b && $user_b->id, 'loaded or created user';
 
 RT->Config->Set( AutocompleteOwners => 1 );
-RT::Test->started_ok;
+my ($baseurl, $agent_a) = RT::Test->started_ok;
 
 ok( RT::Test->set_rights(
     { Principal => $user_a, Right => [qw(SeeQueue ShowTicket CreateTicket ReplyToTicket)] },
     { Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
 ), 'set rights');
 
-my $agent_a = RT::Test::Web->new;
 ok $agent_a->login('user_a', 'password'), 'logged in as user A';
 
 diag "current user has no right to own, nobody selected as owner on create";
diff --git a/t/web/unlimited_search.t b/t/web/unlimited_search.t
index f7cab4d..7ec7f4d 100644
--- a/t/web/unlimited_search.t
+++ b/t/web/unlimited_search.t
@@ -3,7 +3,7 @@
 use strict;
 
 use RT::Test tests => 83;
-RT::Test->started_ok;
+my ($baseurl, $agent) = RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new($RT::SystemUser);
 for ( 1 .. 75 ) {
@@ -15,7 +15,6 @@ for ( 1 .. 75 ) {
     );
 }
 
-my $agent = RT::Test::Web->new;
 ok $agent->login('root', 'password'), 'logged in as root';
 
 $agent->get_ok('/Search/Build.html');

commit e5dbe37e795630011fb113e000f72baca8f83433
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Sep 16 15:31:38 2010 -0400

    Rearrange the templates pod so we have all Variables in one section

diff --git a/docs/templates.pod b/docs/templates.pod
index ab54905..5df4910 100644
--- a/docs/templates.pod
+++ b/docs/templates.pod
@@ -32,8 +32,29 @@ We welcome contributions of HTML-ization of builtin templates.
 
 =back
 
+=head2 Template Types
+
+Templates have a Type which dictates which level of code execution is
+allowed.
+
+Templates of type C<Perl> are evaluated using L<Text::Template>
+which allows arbitrary code execution. Only users which have the global
+C<ExecuteCode> privilege may write templates of type C<Perl>. Historically,
+this has been the only type of Template available.
+
+Templates of type C<Simple> permit only simple variable interpolation.
+No special privilege beyond C<ModifyTemplate> is needed to write C<Simple>
+templates.
+
+For both types of templates, text between curly braces C<{ ... }> is
+interpolated. For C<Perl> templates, this text can be any code (see
+L<Text::Template/Details>). For C<Simple> templates, only simple variables
+are permitted; for example C<{ $TicketSubject }>.
+
 =head2 Variables
 
+=head3 Perl templates
+
 The variables that your templates may use include:
 
 =over 4
@@ -61,26 +82,7 @@ A localization function. See L<Locale::Maketext>.
 
 =back
 
-=head2 Template Types
-
-Templates have a Type which dictates which level of code execution is
-allowed.
-
-Templates of type C<Perl> are evaluated using L<Text::Template>
-which allows arbitrary code execution. Only users which have the global
-C<ExecuteCode> privilege may write templates of type C<Perl>. Historically,
-this has been the only type of Template available.
-
-Templates of type C<Simple> permit only simple variable interpolation.
-No special privilege beyond C<ModifyTemplate> is needed to write C<Simple>
-templates.
-
-For both types of templates, text between curly braces C<{ ... }> is
-interpolated. For C<Perl> templates, this text can be any code (see
-L<Text::Template/Details>). For C<Simple> templates, only simple variables
-are permitted; for example C<{ $TicketSubject }>.
-
-=head3 Selected Simple Template variables
+=head3 Selected Simple template variables
 
 =over 4
 
@@ -120,5 +122,7 @@ For example, C<$TicketCFDepartment>.
 
 For example, C<$TransactionCFLocation>.
 
+=back
+
 =cut
 

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


More information about the Rt-commit mailing list