aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/helpers
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-07 16:46:19 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-07 16:46:19 +0100
commit0f7de6563d4c96fa1ec9c429cca7e42259e25422 (patch)
tree44383db10edd2136e471bba208170550d095b97d /t/app/helpers
parenta82a51695eacf94b7523502b3a48e1de6836fec0 (diff)
parent77460615cf9d08175e385ada6e03ba96b512c935 (diff)
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 't/app/helpers')
-rw-r--r--t/app/helpers/send_email.t19
1 files changed, 13 insertions, 6 deletions
diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t
index 2e90b9f1a..5ab84e017 100644
--- a/t/app/helpers/send_email.t
+++ b/t/app/helpers/send_email.t
@@ -15,11 +15,17 @@ use Email::Send::Test;
use Path::Class;
use_ok 'FixMyStreet::App';
-my $c = FixMyStreet::App->new;
-
-# fake up the request a little
-$c->req->uri( URI->new('http://localhost/') );
-$c->req->base( $c->req->uri );
+my $c = FixMyStreet::App->new(
+ {
+ request => Catalyst::Request->new(
+ {
+ base => URI->new('http://fixmystreet.com/'),
+ uri => URI->new('http://fixmystreet.com/')
+ }
+ ),
+ }
+);
+$c->setup_request();
# set some values in the stash
$c->stash->{foo} = 'bar';
@@ -40,7 +46,8 @@ my $email_as_string = $emails[0]->as_string;
ok $email_as_string =~ s{\s+Date:\s+\S.*?$}{}xms, "Found and stripped out date";
my $expected_email_content = file(__FILE__)->dir->file('send_email_sample.txt')->slurp;
-$expected_email_content =~ s{CONTACT_EMAIL}{ FixMyStreet->config('CONTACT_EMAIL') }e;
+my $sender = '"' . FixMyStreet->config('CONTACT_NAME') . '" <' . FixMyStreet->config('CONTACT_EMAIL') . '>';
+$expected_email_content =~ s{CONTACT_EMAIL}{$sender};
is $email_as_string,
$expected_email_content,