[Jifty-commit] r1569 - in jifty/trunk: lib/Jifty t/TestApp/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jul 14 04:11:03 EDT 2006


Author: jesse
Date: Fri Jul 14 04:11:02 2006
New Revision: 1569

Added:
   jifty/trunk/t/TestApp/t/08-notifications.t
Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Notification.pm

Log:
 r13922 at pinglin:  jesse | 2006-07-14 03:28:08 -0400
 * Stop notification from flipping out if you use a scalar as the to
 r13923 at pinglin:  jesse | 2006-07-14 03:42:07 -0400
 * fix the compile failure
 r13924 at pinglin:  jesse | 2006-07-14 03:42:34 -0400
 * basic smoke test for jifty's notifications 


Modified: jifty/trunk/lib/Jifty/Notification.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Notification.pm	(original)
+++ jifty/trunk/lib/Jifty/Notification.pm	Fri Jul 14 04:11:02 2006
@@ -43,9 +43,7 @@
     my %args = @_;
 
     # initialize message bits to avoid 'undef' warnings
-    for (qw(body preface footer subject)) {
-        $self->$_('');
-    }
+    #for (qw(body preface footer subject)) { $self->$_(''); }
     $self->_recipients( [] );
 
     while ( my ( $arg, $value ) = each %args ) {
@@ -206,11 +204,12 @@
 
     my $currentuser_object_class = Jifty->config->framework('ApplicationClass')."::CurrentUser";
     for my $to ( grep {defined} ($self->to, $self->to_list) ) {
+        if ($to->can('id')) {
         next if     $currentuser_object_class->can("nobody")
                 and $to->id == $currentuser_object_class->nobody->id;
                 
         next if $to->id == $currentuser_object_class->superuser->id;
-        
+        } 
         $self->to($to);
         $self->recipients($to);
         $self->send_one_message(@_);

Added: jifty/trunk/t/TestApp/t/08-notifications.t
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/t/08-notifications.t	Fri Jul 14 04:11:02 2006
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+use lib 't/lib';
+use Jifty::SubTest;
+
+use Jifty::Test tests => 2;
+use_ok('Jifty::Notification');
+
+TODO {local $TODO = "Actually write tests"; ok(0, "Test notifications")};
+
+1;


More information about the Jifty-commit mailing list