[prev] [thread] [next] [lurker] [Date index for 2002/10/10]
I think this looks right, I've been poking about a bit :) [gavin@localhost Plugin]$ diff -up Subscribe.pm.dist Subscribe.pm --- Subscribe.pm.dist Wed Oct 9 22:21:05 2002 +++ Subscribe.pm Wed Oct 9 22:29:26 2002 @@ -17,11 +17,9 @@ sub process { my $user_id = $mail->from(); my $user = Siesta::User->new($user_id); - + # check to see if they're already subbed - my %members = map { $_->id() => 1 } $list->members(); - - if ( $members{$user_id} ) { + if ( $list->is_member($user_id) ) { $self->already_subbed($mail); return 1; } I couldn't work out how to fix the mock'd list object into getting the test to work. I've not used Test::MockObject before I'm afraid. One thing I'd like to add to the TODO is seperating the email templates away from the modules so they can be easily edited. Maybe have $list->get_template('already-on') etc? Cheers, Gavin.
Generated at 13:56 on 01 Jul 2004 by mariachi 0.52