[Rt-commit] r18243 - in rt/3.999/branches/lorzy: . etc lib/RT lib/RT/Search lib/RT/Test share/html/Dashboards share/html/Elements share/html/Search share/html/Search/Elements share/html/Ticket/Elements t t/ticket t/web

clkao at bestpractical.com clkao at bestpractical.com
Thu Feb 5 03:59:24 EST 2009


Author: clkao
Date: Thu Feb  5 03:59:24 2009
New Revision: 18243

Added:
   rt/3.999/branches/lorzy/lib/RT/Test/Warnings/
   rt/3.999/branches/lorzy/lib/RT/Test/Warnings.pm
   rt/3.999/branches/lorzy/lib/RT/Test/Warnings/Appender.pm
Modified:
   rt/3.999/branches/lorzy/   (props changed)
   rt/3.999/branches/lorzy/etc/config.yml
   rt/3.999/branches/lorzy/lib/RT/Dashboard.pm
   rt/3.999/branches/lorzy/lib/RT/Dispatcher.pm
   rt/3.999/branches/lorzy/lib/RT/Search/Googleish.pm
   rt/3.999/branches/lorzy/lib/RT/Test.pm
   rt/3.999/branches/lorzy/lib/RT/Test/Web.pm
   rt/3.999/branches/lorzy/share/html/Dashboards/Render.html
   rt/3.999/branches/lorzy/share/html/Dashboards/Subscription.html
   rt/3.999/branches/lorzy/share/html/Elements/ShowSearch
   rt/3.999/branches/lorzy/share/html/Search/Build.html
   rt/3.999/branches/lorzy/share/html/Search/Bulk.html
   rt/3.999/branches/lorzy/share/html/Search/Elements/EditSearches
   rt/3.999/branches/lorzy/share/html/Search/Results.html
   rt/3.999/branches/lorzy/share/html/Search/Simple.html
   rt/3.999/branches/lorzy/share/html/Ticket/Elements/ShowPeople
   rt/3.999/branches/lorzy/share/html/Ticket/Elements/Tabs
   rt/3.999/branches/lorzy/t/savedsearch.t
   rt/3.999/branches/lorzy/t/ticket/deferred_owner.t
   rt/3.999/branches/lorzy/t/ticket/scrips_batch.t
   rt/3.999/branches/lorzy/t/ticket/search_by_watcher.t
   rt/3.999/branches/lorzy/t/web/basic.t
   rt/3.999/branches/lorzy/t/web/command_line.t
   rt/3.999/branches/lorzy/t/web/custom_frontpage.t
   rt/3.999/branches/lorzy/t/web/custom_search.t
   rt/3.999/branches/lorzy/t/web/dashboards-groups.t
   rt/3.999/branches/lorzy/t/web/dashboards.t
   rt/3.999/branches/lorzy/t/web/query_builder.t

Log:
merge down

Modified: rt/3.999/branches/lorzy/etc/config.yml
==============================================================================
--- rt/3.999/branches/lorzy/etc/config.yml	(original)
+++ rt/3.999/branches/lorzy/etc/config.yml	Thu Feb  5 03:59:24 2009
@@ -39,6 +39,7 @@
           - IE8
           - ie7-recalc
           - ie7-squish
+    - TestServerWarnings: {}
   PubSub: 
     Backend: Memcached
     Enable: ~

Modified: rt/3.999/branches/lorzy/lib/RT/Dashboard.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Dashboard.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Dashboard.pm	Thu Feb  5 03:59:24 2009
@@ -242,7 +242,7 @@
     push @objects, $CurrentUser->user_object
       if $self->current_user->has_right(
         right  => "${prefix}OwnDashboard",
-        object => RT->system_user,
+        object => RT->system,
       );
 
     my $groups = RT::Model::GroupCollection->new( current_user => $CurrentUser );
@@ -262,7 +262,7 @@
     push @objects, RT::System->new( current_user => $CurrentUser )
       if $CurrentUser->has_right(
         right  => "${prefix}Dashboard",
-        object => RT->system_user,
+        object => RT->system,
       );
 
     return @objects;

Modified: rt/3.999/branches/lorzy/lib/RT/Dispatcher.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Dispatcher.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Dispatcher.pm	Thu Feb  5 03:59:24 2009
@@ -114,6 +114,7 @@
         || Jifty->web->request->path =~ m{^/Elements/Header$}
         || Jifty->web->request->path =~ m{^/Elements/Footer$}
         || Jifty->web->request->path =~ m{^/Elements/Logo$}
+        || Jifty->web->request->path =~ m{^/__jifty/test_warnings$}
         || Jifty->web->request->path =~ m{^/__jifty/(css|js)} );
 };
 

Modified: rt/3.999/branches/lorzy/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Search/Googleish.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Search/Googleish.pm	Thu Feb  5 03:59:24 2009
@@ -74,7 +74,7 @@
     my $self = shift;
     my %args = @_;
 
-    $self->{'Queues'} = delete( $args{'Queues'} ) || [];
+    $self->{'queues'} = delete( $args{'queues'} ) || [];
     $self->SUPER::_init(%args);
 }
 
@@ -145,7 +145,7 @@
     }
 
     # restrict to any queues requested by the caller
-    for my $queue ( @{ $self->{'Queues'} } ) {
+    for my $queue ( @{ $self->{'queues'} } ) {
         my $queue_obj = RT::Model::Queue->new( current_user => $self->tickets_obj->current_user );
         $queue_obj->load($queue) or next;
         my $quoted_queue = $Queue->name;
@@ -158,7 +158,8 @@
     if ( !@status_clauses ) {
         push @tql_clauses,
           join( " OR ", map "Status = '$_'",
-                  RT::Model::Queue->status_schema->active() );
+                  RT::Model::Queue->status_schema->valid( 'initial', 'active'
+                      ) );
     }
     else {
         push @tql_clauses, join( " OR ", sort @status_clauses );

Modified: rt/3.999/branches/lorzy/lib/RT/Test.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Test.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Test.pm	Thu Feb  5 03:59:24 2009
@@ -155,7 +155,7 @@
         return ( $existing_server, RT::Test::Web->new );
     }
     my $server = Jifty::Test->make_server;
-    $RT::Test::server_url = $server->started_ok . "/";
+    $RT::Test::server_url = $server->started_ok;
 
     return ( $RT::Test::server_url, RT::Test::Web->new );
 }

Added: rt/3.999/branches/lorzy/lib/RT/Test/Warnings.pm
==============================================================================
--- (empty file)
+++ rt/3.999/branches/lorzy/lib/RT/Test/Warnings.pm	Thu Feb  5 03:59:24 2009
@@ -0,0 +1,14 @@
+package RT::Test::Warnings;
+use strict;
+use warnings;
+
+use RT::Test::Warnings::Appender;
+use Log::Log4perl;
+
+sub import {
+    my $root = Log::Log4perl->get_logger('');
+    my $a = RT::Test::Warnings::Appender->new( name => "WarningAppender" );
+    $root->add_appender($a);
+}
+
+1;

Added: rt/3.999/branches/lorzy/lib/RT/Test/Warnings/Appender.pm
==============================================================================
--- (empty file)
+++ rt/3.999/branches/lorzy/lib/RT/Test/Warnings/Appender.pm	Thu Feb  5 03:59:24 2009
@@ -0,0 +1,18 @@
+package RT::Test::Warnings::Appender;
+use strict;
+use warnings;
+use base qw/Log::Log4perl::Appender/;
+
+sub new {
+    my $class = shift;
+    return bless {@_}, $class;
+}
+
+sub log {
+    my $self = shift;
+    my $message = $_[0]{message};
+    my @messages = ref $message eq "ARRAY" ? @{$message} : ($message);
+    warn @messages;
+}
+
+1;

Modified: rt/3.999/branches/lorzy/lib/RT/Test/Web.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Test/Web.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Test/Web.pm	Thu Feb  5 03:59:24 2009
@@ -135,56 +135,4 @@
     return 1;
 }
 
-sub get_warnings {
-    my $self         = shift;
-    my $server_class = 'RT::Interface::Web::Standalone';
-
-    my $url = $server_class->test_warning_path;
-
-    local $Test::Builder::Level = $Test::Builder::Level + 1;
-    return unless $self->get_ok($url);
-
-    my @warnings = $server_class->decode_warnings( $self->content );
-    return @warnings;
-}
-
-sub warning_like {
-    my $self = shift;
-    my $re   = shift;
-    my $name = shift;
-
-    local $Test::Builder::Level = $Test::Builder::Level + 1;
-
-    my @warnings = $self->get_warnings;
-    if ( @warnings == 0 ) {
-        Test::More::fail("no warnings emitted; expected 1");
-        return 0;
-    }
-    elsif ( @warnings > 1 ) {
-        Test::More::fail( scalar(@warnings) . " warnings emitted; expected 1" );
-        for (@warnings) {
-            Test::More::diag("got warning: $_");
-        }
-        return 0;
-    }
-
-    return Test::More::like( $warnings[0], $re, $name );
-}
-
-sub no_warnings_ok {
-    my $self = shift;
-    my $name = shift || "no warnings emitted";
-
-    local $Test::Builder::Level = $Test::Builder::Level + 1;
-
-    my @warnings = $self->get_warnings;
-
-    Test::More::is( @warnings, 0, $name );
-    for (@warnings) {
-        Test::More::diag("got warning: $_");
-    }
-
-    return @warnings == 0 ? 1 : 0;
-}
-
 1;

Modified: rt/3.999/branches/lorzy/share/html/Dashboards/Render.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Dashboards/Render.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Dashboards/Render.html	Thu Feb  5 03:59:24 2009
@@ -55,7 +55,6 @@
 % }
 
 <table class="dashboard">
-<table border="0" width="100%">
 <tr valign="top">
 
 <td class="boxcontainer">
@@ -68,8 +67,6 @@
 </td>
 
 % }
-</td>
-
 </tr>
 </table>
 
@@ -94,7 +91,7 @@
     last;
 }
 
-my $rows = $Loaded ? $SubscriptionObj->sub_value('Rows') : 20;
+my $rows = $Loaded ? $SubscriptionObj->sub_value('rows') : 20;
 my $title = _( 'Dashboard %1', $dashboard_obj->name );
 
 my %panes = %{ $dashboard_obj->panes };

Modified: rt/3.999/branches/lorzy/share/html/Dashboards/Subscription.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Dashboards/Subscription.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Dashboards/Subscription.html	Thu Feb  5 03:59:24 2009
@@ -100,7 +100,7 @@
 <br />
 <input type="radio" name="frequency" value="weekly"<% $fields{'frequency'} eq
 'weekly' ? 'checked="checked"' : "" |n %> />
-<&|/l&>weekly</&></input>, <&|/l&>on</&>
+<&|/l&>weekly</&>, <&|/l&>on</&>
 <select name="dow">
     <option value="Monday" <% $fields{'Dow'} eq 'Monday' ? 'selected="selected"' : '' %>><&|/l&>Monday</&></option>
     <option value="Tuesday" <% $fields{'Dow'} eq 'Tuesday' ? 'selected="selected"' : '' %>><&|/l&>Tuesday</&></option>
@@ -111,15 +111,16 @@
     <option value="Sunday" <% $fields{'Dow'} eq 'Sunday' ? 'selected="selected"' : '' %>><&|/l&>Sunday</&></option>
 </select>
 <&|/l&>weeks</&>
-<select name="Fow">
+<select name="fow">
 % for my $f ( qw/1 2 3 4/ ) {
-    <option value="<%$f%>" <% $fields{'Fow'} == $f ? 'selected="selected"' : '' %>><% $f %></option>
+    <option value="<%$f%>" <% $fields{'fow'} == $f ? 'selected="selected"' : '' %>><% $f %></option>
 % }
 <br />
+</select>
 
 <input type="radio" name="frequency" value="monthly"<% $fields{'frequency'} eq
 'monthly' ? 'checked="checked"' : "" |n %>/>
-<&|/l&>monthly</&></input> , <&|/l&>on day</&>
+<&|/l&>monthly</&>, <&|/l&>on day</&>
 <select name="dom">
 %   for my $dom (1..31) {
     <option value="<% $dom %>" <% $fields{'dom'} == $dom ?
@@ -129,7 +130,7 @@
 <br />
 
 <input type="radio" name="frequency" value="never" <% $fields{'frequency'} eq
-'never' ? 'checked="checked"' : "" |n%>>
+'never' ? 'checked="checked"' : "" |n%> />
     <&|/l&>never</&>
 </td></tr>
 <tr><td class="label">

Modified: rt/3.999/branches/lorzy/share/html/Elements/ShowSearch
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Elements/ShowSearch	(original)
+++ rt/3.999/branches/lorzy/share/html/Elements/ShowSearch	Thu Feb  5 03:59:24 2009
@@ -60,7 +60,7 @@
 my $SearchArg;
 my $customize;
 my $query_display_component = '/Elements/CollectionList';
-my $query_link_url = RT->config->get('WebPath').'Search/Results.html';
+my $query_link_url = RT->config->get('WebPath').'/Search/Results.html';
 
 if ($saved_search) {
     my ( $container_object, $search_id ) = _parse_saved_search($saved_search);
@@ -113,8 +113,8 @@
 $m->callback(
     %ARGS,
     callback_name  => 'ModifySearch',
-    OriginalSearch => $SearchArg,
-    Search         => $ProcessedSearchArg,
+    original_search => $SearchArg,
+    search         => $ProcessedSearchArg,
 );
 
 foreach ( $SearchArg, $ProcessedSearchArg ) {

Modified: rt/3.999/branches/lorzy/share/html/Search/Build.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Search/Build.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Search/Build.html	Thu Feb  5 03:59:24 2009
@@ -284,7 +284,7 @@
 
 $session{'CurrentSearchHash'} = {
     %query,
-    SearchId    => $saved_search{'id'},
+    search_id    => $saved_search{'id'},
     object      => $saved_search{'object'},
     description => $saved_search{'description'},
 };

Modified: rt/3.999/branches/lorzy/share/html/Search/Bulk.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Search/Bulk.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Search/Bulk.html	Thu Feb  5 03:59:24 2009
@@ -54,7 +54,7 @@
     rows => $rows,
     order_by => $order_by,
     order => $order,
-    saved_searchid => $saved_searchid &>
+    saved_search_id => $saved_search_id &>
 
 <& /Elements/ListActions, actions => \@results &>
 <form method="post" action="<% RT->config->get('WebPath') %>/Search/Bulk.html" enctype="multipart/form-data">
@@ -391,5 +391,5 @@
 $order => 'ASC'
 $order_by => 'id'
 $query => undef
-$saved_searchid => undef
+$saved_search_id => undef
 </%args>

Modified: rt/3.999/branches/lorzy/share/html/Search/Elements/EditSearches
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Search/Elements/EditSearches	(original)
+++ rt/3.999/branches/lorzy/share/html/Search/Elements/EditSearches	Thu Feb  5 03:59:24 2009
@@ -100,7 +100,7 @@
     my %arg = (
         Query       => {},
         SavedSearch => {},
-        SearchFields => [qw(Query format order_by order rows_per_page)],
+        SearchFields => [qw(query format order_by order rows_per_page)],
         @_
     );
 
@@ -182,7 +182,7 @@
     push @results, _("Deleted saved search");
 }
 elsif ( $ARGS{'saved_search_copy'} ) {
-    my ($container, $id ) = _parse_saved_search( $ARGS{'saved_searchid'} );
+    my ($container, $id ) = _parse_saved_search( $ARGS{'saved_search_id'} );
     $saved_search->{'object'} = $container->attributes->withid( $id );
     if ( $ARGS{'saved_search_description'} && $ARGS{'saved_search_description'} ne $saved_search->{'object'}->description ) {
         $saved_search->{'description'} = $ARGS{'saved_search_description'};
@@ -210,7 +210,7 @@
 <%ARGS>
 $query        => {}
 $saved_search  => {}
- at search_fields => qw(Query format order_by order rows_per_page)
+ at search_fields => qw(query format order_by order rows_per_page)
 </%ARGS>
 <%INIT>
 

Modified: rt/3.999/branches/lorzy/share/html/Search/Results.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Search/Results.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Search/Results.html	Thu Feb  5 03:59:24 2009
@@ -56,7 +56,7 @@
     rows => $rows,
     order_by => $order_by,
     order => $order,
-    saved_searchid => $saved_searchid &>
+    saved_search_id => $saved_search_id &>
 <& /Elements/CollectionList, 
     query => $query,
     allow_sorting => 1,
@@ -193,5 +193,5 @@
 $page => 1
 $order_by => undef
 $order => undef
-$saved_searchid => undef
+$saved_search_id => undef
 </%ARGS>

Modified: rt/3.999/branches/lorzy/share/html/Search/Simple.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Search/Simple.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Search/Simple.html	Thu Feb  5 03:59:24 2009
@@ -79,7 +79,7 @@
 use RT::Search::Googleish;
 
 if ($q) {
-    my $tickets = RT::Model::TicketCollection->new();
+    my $tickets = RT::Model::TicketCollection->new(current_user => Jifty->web->current_user);
     if ($q =~ /^#?(\d+)$/) {
         RT::Interface::Web::redirect(RT->config->get('WebURL')."Ticket/Display.html?id=".$1);
     }
@@ -91,8 +91,8 @@
     }
 
     my %args = (
-        Argument   => $q,
-        TicketsObj => $tickets,
+        argument   => $q,
+        tickets_obj => $tickets,
     );
 
     $m->callback( %ARGS, callback_name => 'SearchArgs', args => \%args);

Modified: rt/3.999/branches/lorzy/share/html/Ticket/Elements/ShowPeople
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Ticket/Elements/ShowPeople	(original)
+++ rt/3.999/branches/lorzy/share/html/Ticket/Elements/ShowPeople	Thu Feb  5 03:59:24 2009
@@ -49,7 +49,7 @@
   <tr>
     <td class="label"><&|/l&>Owner</&>:</td>
     <td class="value"><& /Elements/ShowUser, user => $ticket->owner_obj, ticket => $ticket &>
-    <& /Elements/ShowUserEmailFrequency, user => $ticket->owner_obj, ticket => $ticket &></td></td>
+    <& /Elements/ShowUserEmailFrequency, user => $ticket->owner_obj, ticket => $ticket &></td>
   </tr>
   <tr>
     <td class="labeltop"><&|/l&>Requestors</&>:</td>

Modified: rt/3.999/branches/lorzy/share/html/Ticket/Elements/Tabs
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Ticket/Elements/Tabs	(original)
+++ rt/3.999/branches/lorzy/share/html/Ticket/Elements/Tabs	Thu Feb  5 03:59:24 2009
@@ -251,14 +251,14 @@
 my $args = '';
 my $has_query = '';
 my %query_args;
-my $search_id = $ARGS{'saved_searchid'}
+my $search_id = $ARGS{'saved_search_id'}
             || $session{'CurrentSearchHash'}->{'searchid'} || '';
 
 $has_query = 1 if ( $ARGS{'query'} or $session{'CurrentSearchHash'}->{'query'} );
   
 %query_args = (
 
-        saved_searchid => ($search_id eq 'new') ? undef : $search_id,
+        saved_search_id => ($search_id eq 'new') ? undef : $search_id,
         query  => $ARGS{'query'}  || $session{'CurrentSearchHash'}->{'query'},
         format => $ARGS{'format'} || $session{'CurrentSearchHash'}->{'format'},
         order_by => $ARGS{'order_by'}

Modified: rt/3.999/branches/lorzy/t/savedsearch.t
==============================================================================
--- rt/3.999/branches/lorzy/t/savedsearch.t	(original)
+++ rt/3.999/branches/lorzy/t/savedsearch.t	Thu Feb  5 03:59:24 2009
@@ -11,6 +11,7 @@
 
 
 use Test::Warn;
+use RT::Test::Warnings;
 
 # Set up some infrastructure.  These calls are tested elsewhere.
 

Modified: rt/3.999/branches/lorzy/t/ticket/deferred_owner.t
==============================================================================
--- rt/3.999/branches/lorzy/t/ticket/deferred_owner.t	(original)
+++ rt/3.999/branches/lorzy/t/ticket/deferred_owner.t	Thu Feb  5 03:59:24 2009
@@ -7,7 +7,7 @@
 use_ok('RT::Model::Ticket');
 use RT::Test;
 use Test::Warn;
-
+use RT::Test::Warnings;
 
 my $tester = RT::Test->load_or_create_user(
     email => 'tester at localhost',
@@ -25,7 +25,7 @@
 {
     RT::Test->set_rights(
         { principal => $tester->principal,
-          right => [qw(Seequeue ShowTicket CreateTicket OwnTicket)],
+          right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
         },
         { principal => $owner_role_group->principal,
           object => $queue,
@@ -35,14 +35,11 @@
     my $ticket = RT::Model::Ticket->new(current_user => $tester );
     # tester is owner, owner has right to modify owned tickets,
     # this right is required to set somebody as Admincc
-    my ($tid, $txn_id, $msg);
-    warning_like {
-        ($tid, $txn_id, $msg) = $ticket->create(
-            queue => $queue->id,
-            owner => $tester->id,
-            admin_cc    => 'root at localhost',
-        );
-    } qr/User .* was proposed as a ticket owner but has no rights to own tickets in General/;
+    my ( $tid, $txn_id, $msg ) = $ticket->create(
+        queue    => $queue->id,
+        owner    => $tester->id,
+        admin_cc => 'root at localhost',
+    );
 
     
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
@@ -101,16 +98,21 @@
 {
     RT::Test->set_rights(
         { principal => $tester->principal,
-          right => [qw(Seequeue ShowTicket CreateTicket)],
+          right => [qw(SeeQueue ShowTicket CreateTicket)],
         },
     );
     my $ticket = RT::Model::Ticket->new(current_user => $tester );
     # set tester as cc, cc role group has right to own and take tickets
-    my ($tid, $txn_id, $msg) = $ticket->create(
-        queue => $queue->id,
-        owner => $tester->id,
-        cc    => 'tester at localhost',
-    );
+    
+    my ( $tid, $txn_id, $msg );
+    warning_like {
+        ( $tid, $txn_id, $msg ) = $ticket->create(
+            queue => $queue->id,
+            owner => $tester->id,
+            cc    => 'tester at localhost',
+        );
+    }
+qr/User .* was proposed as a ticket owner but has no rights to own tickets in General/;
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
     ok $tid, "created a ticket";
     like $ticket->role_group("cc")->member_emails_as_string, qr/tester\@localhost/, 'tester is in the cc list';

Modified: rt/3.999/branches/lorzy/t/ticket/scrips_batch.t
==============================================================================
--- rt/3.999/branches/lorzy/t/ticket/scrips_batch.t	(original)
+++ rt/3.999/branches/lorzy/t/ticket/scrips_batch.t	Thu Feb  5 03:59:24 2009
@@ -64,7 +64,7 @@
     $m->goto_create_ticket( $queue );
     $m->form_number(3);
     $m->submit;
-    is_deeply parse_handle($tmp_fh), ['Create'], 'Create';
+    is_deeply parse_handle($tmp_fh), ['create'], 'create';
     $m->follow_link_ok(  text => 'Resolve'  );
     $m->form_number(3);
     $m->field( "update_content" => 'resolve it' );

Modified: rt/3.999/branches/lorzy/t/ticket/search_by_watcher.t
==============================================================================
--- rt/3.999/branches/lorzy/t/ticket/search_by_watcher.t	(original)
+++ rt/3.999/branches/lorzy/t/ticket/search_by_watcher.t	Thu Feb  5 03:59:24 2009
@@ -160,10 +160,6 @@
     'Subject NOT LIKE "z" OR (Requestor = "x at example.com" OR Requestor = "y at example.com")' =>
         { xy => 1, x => 1, y => 1, '-' => 1, z => 0 },
 
-        'requestor = "x at example.com" AND requestor = "y at example.com"'
-            => { xy => 1, x => 0, y => 0, '-' => 0, z => 0 },
-    
-    
     );
 run_tests();
 
@@ -171,6 +167,8 @@
 TODO: {
     local $TODO = "we can't generate this query yet";
     %test = (
+        'requestor = "x at example.com" AND requestor = "y at example.com"'
+            => { xy => 1, x => 0, y => 0, '-' => 0, z => 0 },
         'subject LIKE "x" OR requestor = "not-exist at example.com"' =>
             { xy => 1, x => 1, y => 0, '-' => 0, z => 0 },
         'subject NOT LIKE "x" OR requestor = "not-exist at example.com"' =>

Modified: rt/3.999/branches/lorzy/t/web/basic.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/basic.t	(original)
+++ rt/3.999/branches/lorzy/t/web/basic.t	Thu Feb  5 03:59:24 2009
@@ -35,27 +35,23 @@
 $agent->submit();
 is($agent->{'status'}, 200, "Fetched the page ok");
 ok( $agent->content =~ /Logout/i, "Found a logout link");
-$agent->get($url."Ticket/Create.html?queue=1");
+$agent->get($url."/Ticket/Create.html?queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);
 # Start with a string containing characters in latin1
-my $string = "I18N Web Testing æøå";
-my $web_string = $string;
-Encode::from_to($web_string, 'iso-8859-1', 'utf8');
+my $string = Encode::decode_utf8("I18N Web Testing æøå");
 $agent->field('subject' => "Ticket with utf8 body");
-$agent->field('content' => $web_string);
+$agent->field('content' => $string);
 ok($agent->submit(), "Created new ticket with $string as content");
 like( $agent->{'content'}, qr{$string} , "Found the content");
 ok($agent->{redirected_uri}, "Did redirection");
 
-$agent->get($url."Ticket/Create.html?queue=1");
+$agent->get($url."/Ticket/Create.html?queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);
 # Start with a string containing characters in latin1
-$string = "I18N Web Testing æøå";
-$web_string = $string;
-Encode::from_to($web_string, 'iso-8859-1', 'utf8');
-$agent->field('subject' => $web_string);
+$string = Encode::decode_utf8("I18N Web Testing æøå");
+$agent->field('subject' => $string);
 $agent->field('content' => "Ticket with utf8 subject");
 ok($agent->submit(), "Created new ticket with $string as subject");
 
@@ -74,7 +70,7 @@
 
 TODO: {
     todo_skip("Need to handle mason trying to compile images",1);
-$agent->get( $url."NoAuth/images/test.png" );
+$agent->get( $url."/NoAuth/images/test.png" );
 my $file = RT::Test::get_relocatable_file(
   File::Spec->catfile(
     qw(.. .. share html NoAuth images test.png)
@@ -94,7 +90,7 @@
 # XXX: hey-ho, we have these tests in t/web/query-builder
 # TODO: move everything about QB there
 
-my $response = $agent->get($url."Search/Build.html");
+my $response = $agent->get($url."/Search/Build.html");
 ok( $response->is_success, "Fetched " . $url."Search/Build.html" );
 
 # Parsing TicketSQL

Modified: rt/3.999/branches/lorzy/t/web/command_line.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/command_line.t	(original)
+++ rt/3.999/branches/lorzy/t/web/command_line.t	Thu Feb  5 03:59:24 2009
@@ -3,7 +3,7 @@
 use strict;
 use Test::Expect;
 use File::Spec ();
-use Test::More tests => 243;
+use Test::More tests => 241;
 use RT::Test;
 
 my ($baseurl, $m) = RT::Test->started_ok;
@@ -336,11 +336,6 @@
 expect_send("merge $merge_ticket_B $merge_ticket_A", 'Merging the tickets...');
 expect_like(qr/Merge completed/, 'Merged the tickets');
 
-TODO: {
-    local $TODO = "we generate a spurious warning here";
-    $m->no_warnings_ok;
-}
-
 expect_send("show ticket/$merge_ticket_A/history", 'Checking merge on first ticket');
 expect_like(qr/Merged into ticket #$merge_ticket_A by root/, 'Merge recorded in first ticket');
 expect_send("show ticket/$merge_ticket_B/history", 'Checking merge on second ticket');

Modified: rt/3.999/branches/lorzy/t/web/custom_frontpage.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/custom_frontpage.t	(original)
+++ rt/3.999/branches/lorzy/t/web/custom_frontpage.t	Thu Feb  5 03:59:24 2009
@@ -20,7 +20,7 @@
 
 ok $m->login( 'customer' => 'customer' ), "logged in";
 
-$m->get ( $url."Search/Build.html");
+$m->get ( $url."/Search/Build.html");
 
 #create a saved search
 $m->form_name('build_query');
@@ -29,12 +29,12 @@
 $m->field ( "saved_search_description" => 'stupid tickets');
 $m->click_button (name => 'saved_search_save');
 
-$m->get ( $url.'Prefs/MyRT.html' );
+$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';
 
-$m->get ( $url.'Prefs/MyRT.html' );
+$m->get ( $url.'/Prefs/MyRT.html' );
 $m->form_name ('SelectionBox-body');
 # can't use submit form for mutli-valued select as it uses set_fields
 $m->field ('body-Selected' => ['component-QuickCreate', 'system-Unowned Tickets', 'system-My Tickets']);
@@ -44,7 +44,7 @@
 $m->get ( $url );
 $m->content_lacks ('highest priority tickets', 'remove everything from body pane');
 
-$m->get ( $url.'Prefs/MyRT.html' );
+$m->get ( $url.'/Prefs/MyRT.html' );
 $m->form_name ('SelectionBox-body');
 $m->field ('body-Available' => ['component-QuickCreate', 'system-Unowned Tickets', 'system-My Tickets']);
 $m->click_button (name => 'add');

Modified: rt/3.999/branches/lorzy/t/web/custom_search.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/custom_search.t	(original)
+++ rt/3.999/branches/lorzy/t/web/custom_search.t	Thu Feb  5 03:59:24 2009
@@ -20,7 +20,7 @@
 like ($t_link->url, qr/$id/, 'link to the ticket we Created');
 
 $m->content_lacks ('customsearch at localhost', 'requestor not displayed ');
-$m->get ( $url.'Prefs/MyRT.html' );
+$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);

Modified: rt/3.999/branches/lorzy/t/web/dashboards-groups.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/dashboards-groups.t	(original)
+++ rt/3.999/branches/lorzy/t/web/dashboards-groups.t	Thu Feb  5 03:59:24 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use Test::More tests => 40;
+use Test::More tests => 38;
 use RT::Test;
 use RT::Dashboard;
 my ($baseurl, $m) = RT::Test->started_ok;
@@ -95,7 +95,7 @@
 $m->content_lacks("inner dashboard", "no SeeGroupDashboard right");
 $m->content_contains("Permission denied");
 
-$m->warning_like(qr/Permission denied/, "got a permission denied warning");
+$m->warnings_like(qr/Permission denied/, "got a permission denied warning");
 
 $user_obj->principal->grant_right(right => 'SeeGroupDashboard', object => $inner_group);
 $m->get_ok("/Dashboards/Modify.html?id=$id");

Modified: rt/3.999/branches/lorzy/t/web/dashboards.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/dashboards.t	(original)
+++ rt/3.999/branches/lorzy/t/web/dashboards.t	Thu Feb  5 03:59:24 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use Test::More tests => 113;
+use Test::More tests => 99;
 use RT::Test;
 use RT::Dashboard;
 my ($baseurl, $m) = RT::Test->started_ok;
@@ -36,45 +36,33 @@
 
 ok $m->login(customer => 'customer'), "logged in";
 
-$m->get_ok($url."Dashboards/index.html");
+$m->get_ok($url."/Dashboards/index.html");
 $m->content_lacks("New dashboard", "No 'new dashboard' link because we have no CreateOwnDashboard");
 
 $m->no_warnings_ok;
 
-$m->get_ok($url."Dashboards/Modify.html?create=1");
-$m->content_contains("Permission denied");
-$m->content_lacks("Save Changes");
-
 $user_obj->principal->grant_right(
     right  => 'ModifyOwnDashboard',
     object => RT->system
 );
 
 # Modify itself is no longer good enough, you need Create
-$m->get_ok($url."Dashboards/Modify.html?create=1");
-$m->content_contains("Permission denied");
-$m->content_lacks("Save Changes");
-
-$m->warning_like(qr/Permission denied/, "got a permission denied warning");
-
-$user_obj->principal->grant_right(right => 'ModifyOwnDashboard', object => RT->system);
-# Modify itself is no longer good enough, you need Create
-$m->get_ok($url."Dashboards/Modify.html?Create=1");
+$m->get_ok($url."/Dashboards/Modify.html?create=1");
 $m->content_contains("Permission denied");
 $m->content_lacks("Save Changes");
 
-$m->warning_like(qr/Permission denied/, "got a permission denied warning");
+$m->warnings_like(qr/Permission denied/, "got a permission denied warning");
 
 $user_obj->principal->grant_right(
     right  => 'CreateOwnDashboard',
     object => RT->system
 );
 
-$m->get_ok($url."Dashboards/Modify.html?create=1");
+$m->get_ok($url."/Dashboards/Modify.html?create=1");
 $m->content_lacks("Permission denied");
 $m->content_contains("Save Changes");
 
-$m->get_ok($url."Dashboards/index.html");
+$m->get_ok($url."/Dashboards/index.html");
 $m->content_contains("New dashboard", "'New dashboard' link because we now have ModifyOwnDashboard");
 
 $m->follow_link_ok({text => "New dashboard"});
@@ -86,12 +74,12 @@
 $m->content_contains("Saved dashboard different dashboard");
 $m->content_lacks('Delete', "Delete button hidden because we lack DeleteOwnDashboard");
 
-$m->get_ok($url."Dashboards/index.html");
+$m->get_ok($url."/Dashboards/index.html");
 $m->content_lacks("different dashboard", "we lack SeeOwnDashboard");
 
 $user_obj->principal->grant_right(right => 'SeeOwnDashboard', object => RT->system );
 
-$m->get_ok($url."Dashboards/index.html");
+$m->get_ok($url."/Dashboards/index.html");
 $m->content_contains("different dashboard", "we now have SeeOwnDashboard");
 $m->content_lacks("Permission denied");
 
@@ -163,7 +151,7 @@
 $m->form_name( 'subscribe_dashboard' );
 $m->click_button(name => 'save');
 $m->content_contains("Permission denied");
-$m->warning_like(qr/Unable to subscribe to dashboard.*Permission denied/, "got a permission denied warning when trying to subscribe to a dashboard");
+$m->warnings_like(qr/Unable to subscribe to dashboard.*Permission denied/, "got a permission denied warning when trying to subscribe to a dashboard");
 
 Jifty::DBI::Record::Cachable->flush_cache;
 is($user_obj->attributes->named('Subscription'), 0, "no subscriptions");
@@ -194,10 +182,9 @@
 
 $m->get_ok("/Dashboards/Modify.html?id=$id&delete=1");
 $m->content_contains("Permission denied", "unable to delete dashboard because we lack DeleteOwnDashboard");
-$m->warning_like(qr/Couldn't delete dashboard.*Permission denied/, "got a permission denied warning when trying to delete the dashboard");
+$m->warnings_like(qr/Couldn't delete dashboard.*Permission denied/, "got a permission denied warning when trying to delete the dashboard");
 
 $user_obj->principal->grant_right(right => 'DeleteOwnDashboard', object => RT->system );
-
 $m->get_ok("/Dashboards/Modify.html?id=$id");
 $m->content_contains('Delete', "Delete button shows because we have DeleteOwnDashboard");
 
@@ -208,13 +195,13 @@
 $m->get("/Dashboards/Modify.html?id=$id");
 $m->content_lacks("different dashboard", "dashboard was deleted");
 $m->content_contains("Failed to load dashboard $id");
-$m->warning_like(qr/Failed to load dashboard.*Couldn't find row/, "the dashboard was deleted");
+$m->warnings_like(qr/Failed to load dashboard.*Couldn't find row/, "the dashboard was deleted");
 
 $user_obj->principal->grant_right(right => "SuperUser", object => RT->system);
 
 # now test that we warn about searches others can't see
 # first create a personal saved search...
-$m->get_ok($url."Search/Build.html");
+$m->get_ok($url."/Search/Build.html");
 $m->follow_link_ok({text => 'Advanced'});
 $m->form_with_fields('query');
 $m->field(query => "id > 0");
@@ -225,7 +212,7 @@
 $m->click_button(name => "saved_search_save");
 
 # then the system-wide dashboard
-$m->get_ok($url."Dashboards/Modify.html?create=1");
+$m->get_ok($url."/Dashboards/Modify.html?create=1");
 
 $m->form_name('modify_dashboard');
 $m->field("name" => 'system dashboard');
@@ -238,7 +225,7 @@
 $m->follow_link_ok({text => 'Queries'});
 
 $m->form_name('Dashboard-Searches-body');
-$m->field('Searches-body-Available' => ['search-7-RT::Model::User-22']); # XXX: :( :(
+$m->field('Searches-body-Available' => ['search-8-RT::Model::User-22']); # XXX: :( :(
 $m->click_button(name => 'add');
 $m->content_contains("Dashboard updated");
 
@@ -259,5 +246,4 @@
 $omech->content_lacks("personal search", "saved search doesn't show up");
 $omech->content_lacks("dashboard test", "matched ticket doesn't show up");
 
-$m->warning_like(qr/User .* tried to load container user /, "can't see other users' personal searches");
-
+$m->warnings_like(qr/User .* tried to load container user /, "can't see other users' personal searches");

Modified: rt/3.999/branches/lorzy/t/web/query_builder.t
==============================================================================
--- rt/3.999/branches/lorzy/t/web/query_builder.t	(original)
+++ rt/3.999/branches/lorzy/t/web/query_builder.t	Thu Feb  5 03:59:24 2009
@@ -25,7 +25,7 @@
 
 # {{{ Query Builder tests
 
-my $response = $agent->get($url."Search/Build.html");
+my $response = $agent->get($url."/Search/Build.html");
 ok $response->is_success, "Fetched ". $url ."Search/Build.html";
 
 sub get_query_from_form {
@@ -144,7 +144,7 @@
 diag "click advanced, enter 'C1 OR ( C2 AND C3 )', apply, aggregators should stay the same."
     if $ENV{'TEST_VERBOSE'};
 {
-    my $response = $agent->get($url."Search/Edit.html");
+    my $response = $agent->get($url."/Search/Edit.html");
     ok( $response->is_success, "Fetched /Search/Edit.html" );
     ok($agent->form_number(3), "found the form");
     $agent->field("query", "Status = 'new' OR ( Status = 'open' AND subject LIKE 'office' )");
@@ -212,8 +212,8 @@
         );
         ok($return, 'Created CF') or diag "error: $msg";
     }
-    $response = $agent->get($url."Search/Build.html?new_query=1");
-    ok( $response->is_success, "Fetched " . $url."Search/Build.html" );
+    $response = $agent->get($url."/Search/Build.html?new_query=1");
+    ok( $response->is_success, "Fetched " . $url."/Search/Build.html" );
 
     ok($agent->form_name('build_query'), "found the form once");
     $agent->field("ValueOf'CF.{\x{442}}'", "\x{441}");
@@ -232,7 +232,7 @@
 diag "input a condition, select (several conditions), click delete"
     if $ENV{'TEST_VERBOSE'};
 {
-    my $response = $agent->get( $url."Search/Edit.html" );
+    my $response = $agent->get( $url."/Search/Edit.html" );
     ok $response->is_success, "Fetched /Search/Edit.html";
     ok $agent->form_number(3), "found the form";
     $agent->field("query", "( Status = 'new' OR Status = 'open' )");


More information about the Rt-commit mailing list