aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/report_new.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index e12391804..dff04176b 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1,3 +1,4 @@
+use Test::MockModule;
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Web::Scraper;
@@ -1087,6 +1088,21 @@ subtest "Test inactive categories" => sub {
};
};
+subtest "category groups" => sub {
+ my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::FixMyStreet');
+ $cobrand->mock('enable_category_groups', sub { 1 });
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $contact2->update( { extra => { group => 'Roads' } } );
+ $contact9->update( { extra => { group => 'Roads' } } );
+ $contact10->update( { extra => { group => 'Roads' } } );
+ $mech->get_ok("/report/new?lat=$saved_lat&lon=$saved_lon");
+ $mech->content_like(qr{<optgroup label="Roads">\s*<option value='Potholes'>Potholes</option>\s*<option value='Street lighting'>Street lighting</option></optgroup>});
+ };
+};
+
subtest "test report creation for a category that is non public" => sub {
$mech->log_out_ok;
$mech->clear_emails_ok;