[Catalyst-commits] r12580 - in
Catalyst-View-Email/branches/email-sender-porting:
lib/Catalyst/View/Email t t/lib
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Sat Jan 9 21:26:32 GMT 2010
Author: dhoss
Date: 2010-01-09 21:26:32 +0000 (Sat, 09 Jan 2010)
New Revision: 12580
Modified:
Catalyst-View-Email/branches/email-sender-porting/lib/Catalyst/View/Email/Template.pm
Catalyst-View-Email/branches/email-sender-porting/t/07mason.t
Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm
Log:
Untarded the around 'process' { ... } bit, added some debug help
Modified: Catalyst-View-Email/branches/email-sender-porting/lib/Catalyst/View/Email/Template.pm
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/lib/Catalyst/View/Email/Template.pm 2010-01-09 21:21:21 UTC (rev 12579)
+++ Catalyst-View-Email/branches/email-sender-porting/lib/Catalyst/View/Email/Template.pm 2010-01-09 21:26:32 UTC (rev 12580)
@@ -6,7 +6,7 @@
extends 'Catalyst::View::Email';
-our $VERSION = '0.13';
+our $VERSION = '0.13.01';
=head1 NAME
@@ -244,7 +244,7 @@
around 'process' => sub {
my ( $orig, $self, $c, @args ) = @_;
my $stash_key = $self->stash_key;
- return $self->SUPER::process( $c, @args )
+ return $self->$orig( $c, @args )
unless $c->stash->{$stash_key}->{template}
or $c->stash->{$stash_key}->{templates};
warn "Stash: " . $stash_key;
@@ -287,7 +287,7 @@
$c->stash->{$stash_key}->{parts} ||= [];
push @{ $c->stash->{$stash_key}->{parts} }, @parts;
- return $self->SUPER::process($c);
+ return $self->$orig($c);
};
Modified: Catalyst-View-Email/branches/email-sender-porting/t/07mason.t
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/t/07mason.t 2010-01-09 21:21:21 UTC (rev 12579)
+++ Catalyst-View-Email/branches/email-sender-porting/t/07mason.t 2010-01-09 21:26:32 UTC (rev 12580)
@@ -1,37 +1,37 @@
use strict;
use warnings;
use Test::More;
-
-use Email::Send::Test;
+BEGIN { $ENV{EMAIL_SENDER_TRANSPORT} = 'Test' }
use FindBin;
use lib "$FindBin::Bin/lib";
+use Email::Sender::Simple;
+
eval "use Catalyst::View::Mason";
if ( $@ ) {
plan skip_all => 'Catalyst::View::Mason required for Mason tests';
exit;
}
-plan tests => 10;
use_ok('Catalyst::Test', 'TestApp');
TestApp->config->{default_view} = 'Mason';
-
+use Data::Dumper;
my $response;
my $time = time;
ok( ( $response = request("/mason_email?time=$time"))->is_success,
'request ok' );
like( $response->content, qr/Mason Email Ok/, 'controller says ok' );
-my @emails = Email::Send::Test->emails;
-
+my @emails = Email::Sender::Simple->default_transport->deliveries;
+warn "Email: " . Dumper @emails;
cmp_ok(@emails, '==', 1, 'got emails');
-isa_ok( $emails[0], 'Email::MIME', 'email is ok' );
-my @parts = $emails[0]->parts;
+isa_ok( $emails[0]->{'email'}, 'Email::Abstract', 'email is ok' );
+my @parts = $emails[0]->{'email'}[0]->parts;
cmp_ok(@parts, '==', 2, 'got parts');
-
+warn "Parts: " . Dumper @parts;
is($parts[0]->content_type, 'text/plain', 'text/plain ok');
like($parts[0]->body, qr/test-email\@example.com on $time/, 'got content back');
is($parts[1]->content_type, 'text/html', 'text/html ok');
like($parts[1]->body, qr{<em>test-email\@example.com</em> on $time}, 'got content back');
#like($emails[0]->body, qr/$time/, 'Got our email');
-
+done_testing();
Modified: Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm 2010-01-09 21:21:21 UTC (rev 12579)
+++ Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm 2010-01-09 21:26:32 UTC (rev 12580)
@@ -1,7 +1,7 @@
package # Hide from PAUSE
TestApp;
-use Catalyst;
+use Catalyst qw/-Debug/;
use FindBin;
TestApp->config(
More information about the Catalyst-commits
mailing list