diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-07-14 16:25:31 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-07-14 16:25:31 +0100 |
commit | 8c3f0fbfb4bcd33fa8dbc93c2ecb8e0f25ebf383 (patch) | |
tree | 0b596b32bc9248d10e6f4409e39d3285e957d40a /t/app/controller/report_new.t | |
parent | 298db521933eb65591fafa218e78f5f4cdb547ad (diff) | |
parent | 426bc926a422af21ff39cebed836d34e46238500 (diff) |
Merge branch 'issues/forcouncils/192-unused-categories'
Diffstat (limited to 't/app/controller/report_new.t')
-rw-r--r-- | t/app/controller/report_new.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 52bf6da3e..ab6b5d78e 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -890,6 +890,32 @@ foreach my $test ( } +subtest "Test inactive categories" => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ { fixmystreet => '.' } ], + BASE_URL => 'https://www.fixmystreet.com', + MAPIT_URL => 'http://mapit.uk/', + }, sub { + # Around and New report have both categories + $mech->get_ok('/around?pc=GL50+2PR'); + $mech->content_contains('Potholes'); + $mech->content_contains('Trees'); + $mech->get_ok("/report/new?lat=$saved_lat&lon=$saved_lon"); + $mech->content_contains('Potholes'); + $mech->content_contains('Trees'); + $contact2->update( { state => 'inactive' } ); # Potholes + # But when Potholes is inactive, it's not on New report + $mech->get_ok('/around?pc=GL50+2PR'); + $mech->content_contains('Potholes'); + $mech->content_contains('Trees'); + $mech->get_ok("/report/new?lat=$saved_lat&lon=$saved_lon"); + $mech->content_lacks('Potholes'); + $mech->content_contains('Trees'); + # Change back + $contact2->update( { state => 'confirmed' } ); + }; +}; + subtest "test report creation for a category that is non public" => sub { $mech->log_out_ok; $mech->clear_emails_ok; |