diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bexley.pm | 8 | ||||
-rw-r--r-- | t/cobrand/bexley.t | 28 |
2 files changed, 19 insertions, 17 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index fd90a1c30..5900ba02d 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -145,10 +145,12 @@ sub open311_post_send { } elsif ($row->category eq 'Dead animal') { $p1_email = 1; $outofhours_email = 1; - } elsif ($row->category eq 'Parks and open spaces') { + } elsif ($row->category eq 'Gulley covers' || $row->category eq 'Manhole covers') { my $reportType = $row->get_extra_field_value('reportType') || ''; - $p1_email = 1 if $reportType =~ /locked in a park|Wild animal/; - $p1_email = 1 if $dangerous eq 'Yes' && $reportType =~ /Playgrounds|park furniture|gates are broken|Vandalism|Other/; + $p1_email = 1 if $reportType eq 'Cover missing'; + $p1_email = 1 if $dangerous eq 'Yes'; + } elsif ($row->category eq 'Damage to kerb' || $row->category eq 'Damaged road' || $row->category eq 'Damaged pavement') { + $p1_email = 1; } elsif (!$lighting{$row->category}) { $p1_email = 1 if $dangerous eq 'Yes'; $outofhours_email = 1 if $dangerous eq 'Yes'; diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t index d9b41f3b1..511c0770e 100644 --- a/t/cobrand/bexley.t +++ b/t/cobrand/bexley.t @@ -36,8 +36,9 @@ 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"); -$mech->create_contact_ok(body_id => $body->id, category => 'Parks and open spaces', email => "ConfirmPARK"); -$mech->create_contact_ok(body_id => $body->id, category => 'Flooding in the road', email => "FLOD"); +$mech->create_contact_ok(body_id => $body->id, category => 'Gulley covers', email => "GULL"); +$mech->create_contact_ok(body_id => $body->id, category => 'Damaged road', email => "ROAD"); +$mech->create_contact_ok(body_id => $body->id, category => 'Flooding in the road', email => "ConfirmFLOD"); $mech->create_contact_ok(body_id => $body->id, category => 'Flytipping', email => "UniformFLY"); $mech->create_contact_ok(body_id => $body->id, category => 'Dead animal', email => "ANIM"); my $category = $mech->create_contact_ok(body_id => $body->id, category => 'Something dangerous', email => "DANG"); @@ -79,23 +80,22 @@ FixMyStreet::override_config { extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'Yes' } }, { category => 'Something dangerous', code => 'DANG', extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'No' } }, - { category => 'Parks and open spaces', email => ['p1'], code => 'ConfirmPARK', - extra => { 'name' => 'reportType', description => 'Type of report', 'value' => 'Wild animal' } }, - { category => 'Parks and open spaces', code => 'ConfirmPARK', - extra => { 'name' => 'reportType', description => 'Type of report', 'value' => 'Maintenance' } }, - { category => 'Parks and open spaces', code => 'ConfirmPARK', + { category => 'Gulley covers', email => ['p1'], code => 'GULL', + extra => { 'name' => 'reportType', description => 'Type of report', 'value' => 'Cover missing' } }, + { category => 'Gulley covers', code => 'GULL', + extra => { 'name' => 'reportType', description => 'Type of report', 'value' => 'Cover damaged' } }, + { category => 'Gulley covers', email => ['p1'], code => 'GULL', + extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'Yes' } }, + { category => 'Damaged road', code => 'ROAD', email => ['p1'], + extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'No' } }, + { category => 'Damaged road', code => 'ROAD', email => ['p1'], extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'Yes' } }, - { category => 'Parks and open spaces', email => ['p1'], code => 'ConfirmPARK', - extra => [ - { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'Yes' }, - { 'name' => 'reportType', description => 'Type of report', 'value' => 'Vandalism' }, - ] }, { category => 'Lamp post', code => 'LAMP', email => ['thirdparty', 'another'], extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'No' } }, { category => 'Lamp post', code => 'LAMP', email => ['thirdparty', 'another'], extra => { 'name' => 'dangerous', description => 'Was it dangerous?', 'value' => 'Yes' } }, { category => 'Flytipping', code => 'UniformFLY', email => ['eh'] }, - { category => 'Flooding in the road', code => 'FLOD', email => ['flooding'] }, + { category => 'Flooding in the road', code => 'ConfirmFLOD', email => ['flooding'] }, ) { ($report) = $mech->create_problems_for_body(1, $body->id, 'On Road', { category => $test->{category}, cobrand => 'bexley', @@ -155,7 +155,7 @@ FixMyStreet::override_config { subtest 'testing special Open311 behaviour', sub { my @reports = $mech->create_problems_for_body( 1, $body->id, 'Test', { - category => 'Parks and open spaces', cobrand => 'bexley', + category => 'Flooding in the road', cobrand => 'bexley', latitude => 51.408484, longitude => 0.074653, areas => '2494', photo => '74e3362283b6ef0c48686fb0e161da4043bbcc97.jpeg,74e3362283b6ef0c48686fb0e161da4043bbcc97.jpeg', }); |