diff options
Diffstat (limited to 't/cobrand/bexley.t')
-rw-r--r-- | t/cobrand/bexley.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t index 2f74ac03a..f6ec1014d 100644 --- a/t/cobrand/bexley.t +++ b/t/cobrand/bexley.t @@ -30,11 +30,13 @@ my $mech = FixMyStreet::TestMech->new; my $body = $mech->create_body_ok(2494, 'London Borough of Bexley', { send_method => 'Open311', api_key => 'key', 'endpoint' => 'e', 'jurisdiction' => 'j' }); $mech->create_contact_ok(body_id => $body->id, category => 'Abandoned and untaxed vehicles', email => "ABAN"); +$mech->create_contact_ok(body_id => $body->id, category => 'Lamp post', email => "LAMP"); FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'bexley' ], MAPIT_URL => 'http://mapit.uk/', STAGING_FLAGS => { send_reports => 1, skip_checks => 0 }, + COBRAND_FEATURES => { open311_email => { bexley => { p1 => 'p1@bexley', lighting => 'thirdparty@notbexley.example.com' } } }, }, sub { subtest 'cobrand displays council name' => sub { @@ -65,6 +67,22 @@ FixMyStreet::override_config { my $email = $mech->get_email; like $email->header('To'), qr/"Bexley P1 email".*bexley/; like $mech->get_text_body_from_email($email), qr/NSG Ref: Road ID/; + $mech->clear_emails_ok; + }; + + ($report) = $mech->create_problems_for_body(1, $body->id, 'Lamp', { + category => 'Lamp post', cobrand => 'bexley', + latitude => 51.408484, longitude => 0.074653, + }); + + subtest 'Correct email sent' => sub { + my $test_data = FixMyStreet::Script::Reports::send(); + my $req = $test_data->{test_req_used}; + my $c = CGI::Simple->new($req->content); + is $c->param('service_code'), 'LAMP'; + + my $email = $mech->get_email; + like $email->header('To'), qr/thirdparty/; }; }; |