From f9fa9da5ee6ebb474b476c53eaddaf1522c838c7 Mon Sep 17 00:00:00 2001 From: Michal Tomka Date: Thu, 8 Aug 2024 17:22:19 +0200 Subject: [PATCH] superadmin can delete customer user role --- .../App/Smoke/Http/RouteConfigCustomization.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/tests/App/Smoke/Http/RouteConfigCustomization.php b/app/tests/App/Smoke/Http/RouteConfigCustomization.php index 336186cbc9..6c1da7fd61 100644 --- a/app/tests/App/Smoke/Http/RouteConfigCustomization.php +++ b/app/tests/App/Smoke/Http/RouteConfigCustomization.php @@ -171,9 +171,16 @@ private function configureAdminRoutes(RouteConfigCustomizer $routeConfigCustomiz if (preg_match('~^admin_(superadmin_|translation_list$)~', $info->getRouteName())) { $config->changeDefaultRequestDataSet('Only superadmin should be able to see this route.') ->setExpectedStatusCode(403); - $config->addExtraRequestDataSet('Should be OK when logged in as "superadmin".') - ->setAuth(new BasicHttpAuth('superadmin', 'admin123')) - ->setExpectedStatusCode(200); + + if (preg_match('~(_delete$)~', $info->getRouteName())) { + $config->changeDefaultRequestDataSet('Expect redirect by 302 for any delete action.') + ->setAuth(new BasicHttpAuth('superadmin', 'admin123')) + ->setExpectedStatusCode(302); + } else { + $config->addExtraRequestDataSet('Should be OK when logged in as "superadmin".') + ->setAuth(new BasicHttpAuth('superadmin', 'admin123')) + ->setExpectedStatusCode(200); + } } }) ->customizeByRouteName('admin_login', function (RouteConfig $config) {