diff options
author | Struan Donald <struan@exo.org.uk> | 2020-07-06 14:03:06 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2020-07-06 14:03:06 +0100 |
commit | ed9c0ebaee7f00d5e4593c75aaab4815ac296ef7 (patch) | |
tree | 0de285474c248db9ab0986a2dd8895414d7b7c9e | |
parent | 64335826ec42217e1a9a98c0dbc1f13ec034ddb4 (diff) | |
parent | 1e8702dbb972517200b4b1006bbb0440429c84a9 (diff) |
Merge branch 'issues/commercial/1934-bristol-cobrand-categories'
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bristol.pm | 5 | ||||
-rw-r--r-- | t/cobrand/bristol.t | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm index 7e85a3315..5e70c9456 100644 --- a/perllib/FixMyStreet/Cobrand/Bristol.pm +++ b/perllib/FixMyStreet/Cobrand/Bristol.pm @@ -52,7 +52,10 @@ sub categories_restriction { # Email categories with a devolved send_method, so can identify Open311 # categories as those which have a blank send_method. # Also Highways England categories have a blank send_method. - return $rs->search( { 'me.send_method' => undef } ); + return $rs->search( { -or => [ + 'me.send_method' => undef, # Open311 categories + 'me.send_method' => '', # Open311 categories that have been edited in the admin + ] } ); } sub open311_config { diff --git a/t/cobrand/bristol.t b/t/cobrand/bristol.t index d4770b6ee..eacb65ce9 100644 --- a/t/cobrand/bristol.t +++ b/t/cobrand/bristol.t @@ -14,6 +14,12 @@ my $open311_contact = $mech->create_contact_ok( category => 'Street Lighting', email => 'LIGHT', ); +my $open311_edited_contact = $mech->create_contact_ok( + body_id => $body->id, + category => 'Flooding', + email => 'FLOOD', + send_method => '', +); my $email_contact = $mech->create_contact_ok( body_id => $body->id, category => 'Potholes', @@ -38,6 +44,7 @@ subtest 'Only Open311 categories are shown on Bristol cobrand', sub { }, sub { $mech->get_ok("/report/new/ajax?latitude=51.494885&longitude=-2.602237"); $mech->content_contains($open311_contact->category); + $mech->content_contains($open311_edited_contact->category); $mech->content_lacks($email_contact->category); }; }; @@ -49,6 +56,7 @@ subtest 'All categories are shown on FMS cobrand', sub { }, sub { $mech->get_ok("/report/new/ajax?latitude=51.494885&longitude=-2.602237"); $mech->content_contains($open311_contact->category); + $mech->content_contains($open311_edited_contact->category); $mech->content_contains($email_contact->category); }; }; |