aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_new.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-02-13 11:41:49 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-02-13 11:41:49 +0000
commitec3a443ac4c1d7e5caac339c1d48d9900e974fe3 (patch)
tree1f1972f1bb891b93c898be015328d03fbf359058 /t/app/controller/report_new.t
parent6e2da95bc6a758c0cf070b9ddd51acc769f7acf1 (diff)
parent437e023929102f8d4fdd48d063abb0c8ae5af920 (diff)
Merge branch 'issues/forcouncils/276-staff-only-reports'
Diffstat (limited to 't/app/controller/report_new.t')
-rw-r--r--t/app/controller/report_new.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 3c120b0b0..32d86d803 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1733,7 +1733,11 @@ subtest "extra google analytics code displayed on email confirmation problem cre
};
};
-subtest "inspectors get redirected directly to the report page" => sub {
+foreach my $test (
+ { non_public => 0 },
+ { non_public => 1 },
+) {
+ subtest "inspectors get redirected directly to the report page, non_public=$test->{non_public}" => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
BASE_URL => 'https://www.fixmystreet.com',
@@ -1746,10 +1750,14 @@ subtest "inspectors get redirected directly to the report page" => sub {
body => $bodies[0],
permission_type => 'planned_reports',
});
+ $user->user_body_permissions->find_or_create({
+ body => $bodies[0],
+ permission_type => 'report_inspect',
+ });
$mech->log_in_ok('inspector@example.org');
$mech->get_ok('/');
- $mech->submit_form_ok( { with_fields => { pc => 'GL50 2PR' } },
+ $mech->submit_form_ok( { with_fields => { pc => 'EH1 1BB' } },
"submit location" );
$mech->follow_link_ok(
{ text_regex => qr/skip this step/i, },
@@ -1766,6 +1774,7 @@ subtest "inspectors get redirected directly to the report page" => sub {
may_show_name => '1',
phone => '07903 123 456',
category => 'Trees',
+ non_public => $test->{non_public},
}
},
"submit good details"
@@ -1773,6 +1782,7 @@ subtest "inspectors get redirected directly to the report page" => sub {
like $mech->uri->path, qr/\/report\/[0-9]+/, 'Redirects directly to report';
}
-};
+ };
+}
done_testing();