[Rt-commit] r10603 - in rt/branches/3.999-DANGEROUS: lib/RT lib/RT/Model t/api

ruz at bestpractical.com ruz at bestpractical.com
Wed Jan 30 18:51:25 EST 2008


Author: ruz
Date: Wed Jan 30 18:51:25 2008
New Revision: 10603

Modified:
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Test.pm
   rt/branches/3.999-DANGEROUS/t/api/searchbuilder.t
   rt/branches/3.999-DANGEROUS/t/ticket/deffered_owner.t

Log:
* fix t/ticket/deffered_owner.t and t/api/searchbuilder.t

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	Wed Jan 30 18:51:25 2008
@@ -595,7 +595,7 @@
     unless ($create_groups_ret) {
         Jifty->log->fatal( "Couldn't create ticket groups for ticket "
                 . $self->id
-                . ". aborting Ticket creation." );
+                . ". aborting ticket creation." );
         Jifty->handle->rollback();
         return ( 0, 0,
             _("Ticket could not be created due to an internal error") );
@@ -1273,7 +1273,7 @@
 =head2 delete_watcher { type => TYPE, principal_id => PRINCIPAL_ID, Email => EMAIL_ADDRESS }
 
 
-Deletes a Ticket watcher.  Takes two arguments:
+Deletes a ticket watcher.  Takes two arguments:
 
 Type  (one of Requestor,Cc,AdminCc)
 
@@ -1554,7 +1554,7 @@
 
     my $group = RT::Model::Group->new;
     if ( $self->current_user_has_right('ShowTicket') ) {
-        $group->load_ticket_role_group( type => 'Cc', Ticket => $self->id );
+        $group->load_ticket_role_group( type => 'Cc', ticket => $self->id );
     }
     return ($group);
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Test.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Test.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Test.pm	Wed Jan 30 18:51:25 2008
@@ -106,7 +106,7 @@
     my $self = shift;
     my %args = ( privileged => 1, disabled => 0, @_ );
 
-    my $MemberOf = delete $args{'MemberOf'};
+    my $MemberOf = delete $args{'member_of'};
     $MemberOf = [$MemberOf] if defined $MemberOf && !ref $MemberOf;
     $MemberOf ||= [];
 
@@ -273,18 +273,19 @@
 
     require RT::Model::ACECollection;
     foreach my $e (@list) {
-        my $principal = delete $e->{'Principal'};
+        my $principal = delete $e->{'principal'};
         unless ( ref $principal ) {
             if ( $principal =~ /^(everyone|(?:un)?privileged)$/i ) {
                 $principal = RT::Model::Group->new(
-                    current_user => RT->system_user );
+                    current_user => RT->system_user
+                );
                 $principal->load_system_internal_group($1);
             } else {
                 die
                     "principal is not an object, but also is not name of a system group";
             }
         }
-        unless ( $principal->isa('RT::Principal') ) {
+        unless ( $principal->isa('RT::Model::Principal') ) {
             if ( $principal->can('principal_object') ) {
                 $principal = $principal->principal_object;
             }

Modified: rt/branches/3.999-DANGEROUS/t/api/searchbuilder.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/searchbuilder.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/searchbuilder.t	Wed Jan 30 18:51:25 2008
@@ -18,7 +18,7 @@
 
 use_ok('RT::Model::QueueCollection');
 ok(my $queues = RT::Model::QueueCollection->new(current_user => RT->system_user), 'Created a queues object');
-ok( $queues->find_all_rows(),'unlimited the result set of the queues object');
+ok( $queues->unlimit(),'unlimited the result set of the queues object');
 my $items = $queues->items_array_ref();
 my @items = @{$items};
 

Modified: rt/branches/3.999-DANGEROUS/t/ticket/deffered_owner.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/deffered_owner.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/deffered_owner.t	Wed Jan 30 18:51:25 2008
@@ -23,10 +23,10 @@
 diag "check that defering owner doesn't regress" if $ENV{'TEST_VERBOSE'};
 {
     RT::Test->set_rights(
-        { Principal => $tester->principal_object,
+        { principal => $tester->principal_object,
           right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
         },
-        { Principal => $owner_role_group->principal_object,
+        { principal => $owner_role_group->principal_object,
           object => $queue,
           right => [qw(ModifyTicket)],
         },
@@ -36,7 +36,7 @@
     # this right is required to set somebody as AdminCc
     my ($tid, $txn_id, $msg) = $ticket->create(
         queue   => $queue->id,
-        Owner   => $tester->id,
+        owner   => $tester->id,
         AdminCc => 'root at localhost',
     );
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
@@ -44,21 +44,22 @@
     is $ticket->owner, $tester->id, 'correct owner';
     like $ticket->admin_cc_addresses, qr/root\@localhost/, 'root is an admincc';
 }
+
 diag "check that previous trick doesn't work without sufficient rights"
     if $ENV{'TEST_VERBOSE'};
 {
     RT::Test->set_rights(
-        { Principal => $tester->principal_object,
+        { principal => $tester->principal_object,
           right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
         },
     );
-        my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $tester->id) );
+    my $ticket = RT::Model::Ticket->new(current_user => RT::CurrentUser->new(id => $tester->id) );
 
     # tester is owner, owner has right to modify owned tickets,
     # this right is required to set somebody as AdminCc
     my ($tid, $txn_id, $msg) = $ticket->create(
         queue   => $queue->id,
-        Owner   => $tester->id,
+        owner   => $tester->id,
         AdminCc => 'root at localhost',
     );
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
@@ -70,10 +71,10 @@
 diag "check that defering owner really works" if $ENV{'TEST_VERBOSE'};
 {
     RT::Test->set_rights(
-        { Principal => $tester->principal_object,
+        { principal => $tester->principal_object,
           right => [qw(SeeQueue ShowTicket CreateTicket)],
         },
-        { Principal => $queue->cc->principal_object,
+        { principal => $queue->cc->principal_object,
           object => $queue,
           right => [qw(OwnTicket TakeTicket)],
         },
@@ -83,7 +84,7 @@
     # 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,
+        owner => $tester->id,
         Cc    => 'tester at localhost',
     );
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
@@ -95,7 +96,7 @@
 diag "check that defering doesn't work without correct rights" if $ENV{'TEST_VERBOSE'};
 {
     RT::Test->set_rights(
-        { Principal => $tester->principal_object,
+        { principal => $tester->principal_object,
           right => [qw(SeeQueue ShowTicket CreateTicket)],
         },
     );
@@ -104,7 +105,7 @@
     # 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,
+        owner => $tester->id,
         Cc    => 'tester at localhost',
     );
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};


More information about the Rt-commit mailing list