diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/admin/bodies.t | 27 | ||||
-rw-r--r-- | t/cobrand/isleofwight.t | 13 |
2 files changed, 39 insertions, 1 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index 80ee22630..75db6f87c 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -413,4 +413,31 @@ subtest 'check log of the above' => sub { $mech->content_contains('Edited body <a href="/admin/body/' . $body->id . '">Aberdeen City Council</a>'); }; +subtest 'check update disallowed message' => sub { + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'open' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only open reports can have updates left on them.'); + }; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'staff' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only staff will be able to leave updates.'); + }; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'reporter' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only the problem reporter will be able to leave updates'); + }; +}; + done_testing(); diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t index 3cac710da..303cdbc07 100644 --- a/t/cobrand/isleofwight.t +++ b/t/cobrand/isleofwight.t @@ -116,13 +116,24 @@ subtest "only original reporter can comment" => sub { }; }; +subtest "only original reporter can comment" => sub { + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'fixmystreet', + COBRAND_FEATURES => { updates_allowed => { fixmystreet => { 'Isle of Wight' => 'reporter' } } }, + }, sub { + $mech->log_out_ok; + $mech->get_ok('/report/' . $reports[0]->id); + $mech->content_contains('Only the original reporter may leave updates'); + }; +}; + subtest "check moderation label uses correct name" => sub { my $REPORT_URL = '/report/' . $reports[0]->id; FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/', ALLOWED_COBRANDS => ['isleofwight'], }, sub { - $mech->log_out_ok; $mech->log_in_ok( $iow_user->email ); $mech->get_ok($REPORT_URL); $mech->content_lacks('show-moderation'); |