From cdd94a3de1445d0aea4dfc8c18cbae9e315bdda9 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 24 Sep 2018 13:06:44 +0100 Subject: Speed up fetching lists of bodies. Use a HashRefInflator wherever all_sorted is used, with consequential changes to deal with it now not being an object (e.g. add some with_* functions for manual fetching of extra data). --- t/app/controller/admin/defecttypes.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/app/controller/admin') diff --git a/t/app/controller/admin/defecttypes.t b/t/app/controller/admin/defecttypes.t index e7d0e42af..1eaab8414 100644 --- a/t/app/controller/admin/defecttypes.t +++ b/t/app/controller/admin/defecttypes.t @@ -28,6 +28,20 @@ FixMyStreet::override_config { ALLOWED_COBRANDS => ['oxfordshire'], }, sub { my $body = $mech->create_body_ok( 2237, 'Oxfordshire County Council' ); + subtest 'check defect types menu available to superusers' => sub { + my $user = $mech->create_user_ok( + 'superuser@example.com', + name => 'Test Superuser', + is_superuser => 1 + ); + + $mech->log_in_ok( $user->email ); + $mech->get_ok('/admin'); + $mech->content_contains('Defect Types'); + $mech->get_ok('/admin/defecttypes'); + $mech->log_out_ok(); + }; + my $user = $mech->create_user_ok( 'oxford@example.com', name => 'Test User', -- cgit v1.2.3