diff options
Diffstat (limited to 't/app/sendreport')
-rw-r--r-- | t/app/sendreport/email.t | 16 | ||||
-rw-r--r-- | t/app/sendreport/email/highways.t | 10 |
2 files changed, 9 insertions, 17 deletions
diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t index cfd70a097..c9363b787 100644 --- a/t/app/sendreport/email.t +++ b/t/app/sendreport/email.t @@ -20,8 +20,6 @@ my $contact = $mech->create_contact_ok( ); my $row = FixMyStreet::DB->resultset('Problem')->new( { - latitude => 51.023569, - longitude => -3.099055, bodies_str => '1000', category => 'category', cobrand => '', @@ -70,18 +68,4 @@ foreach my $test ( { }; } -$body->update({ name => 'Somerset West and Taunton Council' }); - -subtest 'Test special behaviour' => sub { - my $e = FixMyStreet::SendReport::Email->new; - $contact->update( { state => 'confirmed', email => 'SPECIAL' } ); - $e->add_body( $body ); - FixMyStreet::override_config { - MAPIT_URL => 'http://mapit.uk/' - }, sub { - my ($e) = $e->build_recipient_list( $row, {} ); - like $e->[0], qr/tauntondeane/, 'correct recipient'; - }; -}; - done_testing(); diff --git a/t/app/sendreport/email/highways.t b/t/app/sendreport/email/highways.t index b9a71f23f..6f6c65eb5 100644 --- a/t/app/sendreport/email/highways.t +++ b/t/app/sendreport/email/highways.t @@ -34,7 +34,15 @@ is $e->build_recipient_list($row), 1, 'correct recipient list count'; is_deeply $e->to, [ [ 'highways@example.com', 'Highways England' ] ], 'correct To line'; FixMyStreet::override_config { - COBRAND_FEATURES => { open311_email => { highwaysengland => { area_seven => 'a7@example.com' } } } + COBRAND_FEATURES => {} +}, sub { + $row->set_extra_fields( { name => 'area_name', value => 'Area 7' } ); + is $e->build_recipient_list($row), 1, 'correct recipient list count'; + is_deeply $e->to, [ [ 'highways@example.com', 'Highways England' ] ], 'correct To line'; +}; + +FixMyStreet::override_config { + COBRAND_FEATURES => { open311_email => { highwaysengland => { 'Area 7' => 'a7@example.com' } } } }, sub { $row->set_extra_fields( { name => 'area_name', value => 'Area 7' } ); is $e->build_recipient_list($row), 1, 'correct recipient list count'; |