Permalink
Browse files

The Email::Sender::Simple deliveries no longer returns an array ref i…

…n scalar context.
  • Loading branch information...
1 parent 8c99c5e commit e622002364f6aa16eec7b2a0a22fe9f06ad06ad8 @theory theory committed Oct 13, 2012
Showing with 30 additions and 30 deletions.
  1. +8 −8 t/moderate.t
  2. +4 −4 t/pub.t
  3. +7 −7 t/register.t
  4. +11 −11 t/reset.t
View
@@ -613,11 +613,11 @@ test_psgi +PGXN::Manager::Router->app => sub {
', 'And it should have the proper json';
# Did we send him email?
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'Welcome to PGXN!',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},
@@ -667,11 +667,11 @@ test_psgi +PGXN::Manager::Router->app => sub {
'And the content should say so';
# Did we send him email?
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'Account Request Rejected',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},
View
@@ -195,12 +195,12 @@ sub test_error_response {
});
# Check the alert email.
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'PGXN Manager Internal Server Error',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},
View
@@ -204,12 +204,12 @@ test_psgi $app => sub {
});
# And an email should have been sent.
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'New User Request for tgl',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},
@@ -243,7 +243,7 @@ test_psgi $app => sub {
ok !$res->is_redirect, 'It should not be a redirect response';
is $res->code, 409, 'Should have 409 status code';
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
0, 'No email should have been sent';
# So check the content.
@@ -311,7 +311,7 @@ test_psgi $app => sub {
'TGL should exist';
});
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
1, 'And an admin email should have been sent';
Email::Sender::Simple->default_transport->clear_deliveries;
};
@@ -403,7 +403,7 @@ test_psgi $app => sub {
}, undef, 'tgl'), ['Tom Lane', 'tgl@pgxn.org', '', 'new'], 'TGL should exist';
});
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
1, 'And an admin email should have been sent';
Email::Sender::Simple->default_transport->clear_deliveries;
};
View
@@ -119,7 +119,7 @@ test_psgi $app => sub {
);
});
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
0, 'No email should have been sent'
};
@@ -139,7 +139,7 @@ test_psgi $app => sub {
is $res->content, $mt->maketext('Bad request: no who parameter.'),
'And the content should say so';
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
0, 'No email should have been sent'
};
@@ -164,7 +164,7 @@ test_psgi $app => sub {
ok $sess->{reset_sent},
'The "reset_sent" key should have been set in the session';
- is @{ Email::Sender::Simple->default_transport->deliveries },
+ is +Email::Sender::Simple->default_transport->deliveries,
0, 'But no email should have been sent'
};
@@ -190,12 +190,12 @@ test_psgi $app => sub {
ok $sess->{reset_sent},
'The "reset_sent" key should have been set in the session';
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'Reset Your Password',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},
@@ -229,12 +229,12 @@ test_psgi +PGXN::Manager::Router->app => sub {
is $res->content, $mt->maketext('Success'),
'And the content should say so';
- ok my $deliveries = Email::Sender::Simple->default_transport->deliveries,
+ ok my @deliveries = Email::Sender::Simple->default_transport->deliveries,
'Should have email deliveries.';
- is @{ $deliveries }, 1, 'Should have one message';
- is @{ $deliveries->[0]{successes} }, 1, 'Should have been successfully delivered';
+ is @deliveries, 1, 'Should have one message';
+ is @{ $deliveries[0]{successes} }, 1, 'Should have been successfully delivered';
- my $email = $deliveries->[0]{email};
+ my $email = $deliveries[0]{email};
is $email->get_header('Subject'), 'Reset Your Password',
'The subject should be set';
is $email->get_header('From'), PGXN::Manager->config->{admin_email},

0 comments on commit e622002

Please sign in to comment.