diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-13 10:28:52 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-27 11:40:40 +0000 |
commit | ae88108b6a176744fef215093bcec835b323e5e6 (patch) | |
tree | eedeac40fd753fbb1619959d464655275d027d05 /t | |
parent | aa50b33865148d587e70218d0f8bff9c321cbeb8 (diff) |
[UK] Council reference in .com confirm sent email.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_as_other.t | 4 | ||||
-rw-r--r-- | t/app/model/problem.t | 2 | ||||
-rw-r--r-- | t/cobrand/bucks.t | 15 |
3 files changed, 12 insertions, 9 deletions
diff --git a/t/app/controller/report_as_other.t b/t/app/controller/report_as_other.t index f256374a8..9ed46190b 100644 --- a/t/app/controller/report_as_other.t +++ b/t/app/controller/report_as_other.t @@ -123,7 +123,7 @@ subtest "Body user, has permission to add report as another (existing) user with my $send_confirmation_mail_override = Sub::Override->new( "FixMyStreet::Cobrand::Default::report_sent_confirmation_email", - sub { return 1; } + sub { return 'external_id'; } ); FixMyStreet::Script::Reports::send(); $mech->email_count_is(2); @@ -168,7 +168,7 @@ subtest "Body user, has permission to add report as anonymous user" => sub { my $send_confirmation_mail_override = Sub::Override->new( "FixMyStreet::Cobrand::Default::report_sent_confirmation_email", - sub { return 1; } + sub { return 'external_id'; } ); FixMyStreet::Script::Reports::send(); diff --git a/t/app/model/problem.t b/t/app/model/problem.t index b9bbe4682..503fa9276 100644 --- a/t/app/model/problem.t +++ b/t/app/model/problem.t @@ -633,7 +633,7 @@ subtest 'check can set multiple emails as a single contact' => sub { subtest 'check can turn on report sent email alerts' => sub { my $send_confirmation_mail_override = Sub::Override->new( "FixMyStreet::Cobrand::Default::report_sent_confirmation_email", - sub { return 1; } + sub { return 'external_id'; } ); $mech->clear_emails_ok; diff --git a/t/cobrand/bucks.t b/t/cobrand/bucks.t index e2b4214da..965b90107 100644 --- a/t/cobrand/bucks.t +++ b/t/cobrand/bucks.t @@ -51,9 +51,10 @@ my ($report) = $mech->create_problems_for_body(1, $body->id, 'On Road', { subtest 'flytipping on road sent to extra email' => sub { FixMyStreet::Script::Reports::send(); - my $email = $mech->get_email; + my @email = $mech->get_email; my $tfb = join('', 'illegaldumpingcosts', '@', 'buckscc.gov.uk'); - is $email->header('To'), '"TfB" <' . $tfb . '>'; + is $email[0]->header('To'), '"TfB" <' . $tfb . '>'; + like $mech->get_text_body_from_email($email[1]), qr/report's reference number/; $report->discard_changes; is $report->external_id, 248, 'Report has right external ID'; }; @@ -67,10 +68,11 @@ subtest 'flytipping on road sent to extra email' => sub { }, }); -subtest 'pothole on road not sent to extra email' => sub { +subtest 'pothole on road not sent to extra email, only confirm sent' => sub { $mech->clear_emails_ok; FixMyStreet::Script::Reports::send(); - $mech->email_count_is(0); + $mech->email_count_is(1); + like $mech->get_text_body_from_email, qr/report's reference number/; $report->discard_changes; is $report->external_id, 248, 'Report has right external ID'; }; @@ -96,9 +98,10 @@ my ($report2) = $mech->create_problems_for_body(1, $body->id, 'Drainage problem' subtest 'blocked drain sent to extra email' => sub { $mech->clear_emails_ok; FixMyStreet::Script::Reports::send(); - my $email = $mech->get_email; + my @email = $mech->get_email; my $e = join('@', 'floodmanagement', 'buckscc.gov.uk'); - is $email->header('To'), '"Flood Management" <' . $e . '>'; + is $email[0]->header('To'), '"Flood Management" <' . $e . '>'; + like $mech->get_text_body_from_email($email[1]), qr/report's reference number/; }; $cobrand = FixMyStreet::Cobrand::Buckinghamshire->new(); |