diff options
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bristol.t | 8 | ||||
-rw-r--r-- | t/cobrand/tfl.t | 28 |
2 files changed, 35 insertions, 1 deletions
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); }; }; diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t index f8e0a11c8..cf1ec1c41 100644 --- a/t/cobrand/tfl.t +++ b/t/cobrand/tfl.t @@ -23,6 +23,10 @@ FixMyStreet::DB->resultset('BodyArea')->find_or_create({ area_id => 2457, # Epsom Ewell, outside London, for bus stop test body_id => $body->id, }); +FixMyStreet::DB->resultset('BodyArea')->find_or_create({ + area_id => 2508, # Hackney + body_id => $body->id, +}); my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1); my $staffuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $body, password => 'password'); $staffuser->user_body_permissions->create({ @@ -58,6 +62,13 @@ my $bromley_flytipping = $mech->create_contact_ok( $bromley_flytipping->set_extra_metadata(group => [ 'Street cleaning' ]); $bromley_flytipping->update; +my $hackney = $mech->create_body_ok(2508, 'Hackney Council'); +$mech->create_contact_ok( + body_id => $hackney->id, + category => 'Abandoned Vehicle', + email => 'av-hackney@example.com', +); + my $contact1 = $mech->create_contact_ok( body_id => $body->id, category => 'Bus stops', @@ -748,7 +759,7 @@ subtest 'Test no questionnaire sending' => sub { }; FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'tfl', 'bromley', 'fixmystreet' ], + ALLOWED_COBRANDS => [ 'tfl', 'bromley', 'fixmystreet', 'hackney' ], MAPIT_URL => 'http://mapit.uk/', COBRAND_FEATURES => { internal_ips => { tfl => [ '127.0.0.1' ] }, @@ -864,6 +875,21 @@ for my $test ( 'Trees' ], }, + { + host => 'hackney.fixmystreet.com', + name => "test no hackney categories on red route", + lat => 51.552287, + lon => -0.063326, + expected => [ + 'Bus stops', + 'Flooding', + 'Grit bins', + 'Pothole', + 'Timings', + 'Traffic lights', + 'Trees' + ], + }, ) { subtest $test->{name} . ' on ' . $test->{host} => sub { $mech->host($test->{host}); |