[Catalyst-commits] r12551 - in
Catalyst-View-Email/branches/email-sender-porting/t: . lib
lib/TestApp/View/Email lib/TestApp/View/Email/Template
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Sat Jan 9 00:37:39 GMT 2010
Author: dhoss
Date: 2010-01-09 00:37:39 +0000 (Sat, 09 Jan 2010)
New Revision: 12551
Modified:
Catalyst-View-Email/branches/email-sender-porting/t/06config.t
Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm
Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/AppConfig.pm
Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/Template/AppConfig.pm
Log:
06confit.t now passes. may/may not want to remove the config shit from the test model
Modified: Catalyst-View-Email/branches/email-sender-porting/t/06config.t
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/t/06config.t 2010-01-09 00:20:03 UTC (rev 12550)
+++ Catalyst-View-Email/branches/email-sender-porting/t/06config.t 2010-01-09 00:37:39 UTC (rev 12551)
@@ -1,8 +1,9 @@
use strict;
use warnings;
-use Test::More tests => 13;
+BEGIN { $ENV{EMAIL_SENDER_TRANSPORT} = 'Test' }
-use Email::Send::Test;
+use Test::More;
+use Email::Sender::Simple;
use FindBin;
use lib "$FindBin::Bin/lib";
@@ -16,26 +17,26 @@
ok( ($response = request("/email_app_config?time=$time"))->is_success, 'request ok');
- at emails = Email::Send::Test->emails;
+ at emails = Email::Sender::Simple->default_transport->deliveries;
-is(@emails, 1, "got emails");
-isa_ok( $emails[0], 'Email::MIME', 'email is ok' );
-like($emails[0]->body, qr/$time/, 'Got our email');
+is(scalar @emails, 1, "got emails");
+isa_ok( $emails[0]->{'email'}, 'Email::Abstract', 'email is ok' );
+like($emails[0]->{'email'}->[0]->body, qr/$time/, 'Got our email');
-Email::Send::Test->clear;
+Email::Sender::Simple->default_transport->clear_deliveries;
$time = time;
ok( ($response = request("/template_email_app_config?time=$time"))->is_success, 'request ok');
- at emails = Email::Send::Test->emails;
+ at emails = Email::Sender::Simple->default_transport->deliveries;
-is(@emails, 1, "got emails");
-isa_ok( $emails[0], 'Email::MIME', 'email is ok' );
-my @parts = $emails[0]->parts;
+is(scalar @emails, 1, "got emails");
+isa_ok( $emails[0]->{'email'}, 'Email::Abstract', 'email is ok' );
+my @parts = $emails[0]->{'email'}[0]->parts;
cmp_ok(@parts, '==', 2, 'got 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');
-
+done_testing();
Modified: Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/AppConfig.pm
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/AppConfig.pm 2010-01-09 00:20:03 UTC (rev 12550)
+++ Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/AppConfig.pm 2010-01-09 00:37:39 UTC (rev 12551)
@@ -1,7 +1,7 @@
package # Hide from PAUSE
TestApp::View::Email::AppConfig;
-use Email::Send::Test;
+use Email::Sender::Simple;
use base 'Catalyst::View::Email';
Modified: Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/Template/AppConfig.pm
===================================================================
--- Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/Template/AppConfig.pm 2010-01-09 00:20:03 UTC (rev 12550)
+++ Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp/View/Email/Template/AppConfig.pm 2010-01-09 00:37:39 UTC (rev 12551)
@@ -1,7 +1,7 @@
package # Hide from PAUSE
TestApp::View::Email::Template::AppConfig;
-use Email::Send::Test;
+use Email::Sender::Simple;
use base 'Catalyst::View::Email::Template';
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 00:20:03 UTC (rev 12550)
+++ Catalyst-View-Email/branches/email-sender-porting/t/lib/TestApp.pm 2010-01-09 00:37:39 UTC (rev 12551)
@@ -17,6 +17,7 @@
sender => {
mailer => 'Test',
},
+ content_type => 'text/html',
default => {
view => 'TT',
},
More information about the Catalyst-commits
mailing list