diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-08 15:31:59 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-08 16:18:03 +0100 |
commit | 19a49116e906c8743cda397fecb966cffbce47fb (patch) | |
tree | 00306cdc3cebc033935c680a6b8c28da84ccf601 | |
parent | 3833f1feb9d4760bb0e2d8ba83c06c8455516d88 (diff) |
Add small test of category groups.
-rw-r--r-- | t/app/controller/report_new.t | 16 |
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; |