diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-27 17:52:30 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-27 17:52:30 +0000 |
commit | 251f152b46816ed1c8401cda7f57305d08830af1 (patch) | |
tree | 3c46e9960b113869e757b011ecfdbcbdef5ff3ad /t/cobrand | |
parent | 48c807b87f81ba89732d36b4459a4ca5bd4933ef (diff) | |
parent | ae88108b6a176744fef215093bcec835b323e5e6 (diff) |
Merge branch 'issues/commercial/1273-ref-number-com'
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bucks.t | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/t/cobrand/bucks.t b/t/cobrand/bucks.t index 74684c27e..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,22 +68,24 @@ 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'; }; ($report) = $mech->create_problems_for_body(1, $district->id, 'Off Road', { - category => 'Flytipping', cobrand => 'fixmystreet', + category => 'Flytipping', cobrand => 'buckinghamshire', latitude => 51.813173, longitude => -0.826741, }); subtest 'flytipping off road sent to extra email' => sub { FixMyStreet::Script::Reports::send(); - my $email = $mech->get_email; - is $email->header('To'), '"Chiltern" <flytipping@chiltern>'; + my @email = $mech->get_email; + is $email[0]->header('To'), '"Chiltern" <flytipping@chiltern>'; + like $mech->get_text_body_from_email($email[1]), qr/Please note that Buckinghamshire County Council is not responsible/; $report->discard_changes; is $report->external_id, undef, 'Report has right external ID'; }; @@ -95,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(); |