From ade61b767a2f70198dba1ea3f21601b83a4fc44c Mon Sep 17 00:00:00 2001 From: mrothauer Date: Mon, 5 Feb 2024 22:29:09 +0100 Subject: [PATCH] remove rest from path --- config/routes.php | 2 +- tests/TestCase/Controller/WorkshopsControllerTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/routes.php b/config/routes.php index 0796c43b1..75583691d 100644 --- a/config/routes.php +++ b/config/routes.php @@ -115,7 +115,7 @@ if (Configure::read('isApiEnabled')) { $routes->connect('/api/splitter', ['controller' => 'posts', 'action' => 'getSplitter']); $routes->connect('/api/workshops', ['controller' => 'workshops', 'action' => 'getWorkshopsForHyperModeWebsite']); - $routes->connect('/api/v1/rest/workshops', [ + $routes->connect('/api/v1/workshops', [ 'controller' => 'workshops', 'action' => 'getWorkshopsWithCityFilter', ])->setMethods(['GET']); diff --git a/tests/TestCase/Controller/WorkshopsControllerTest.php b/tests/TestCase/Controller/WorkshopsControllerTest.php index 97fe05931..d87b8a354 100644 --- a/tests/TestCase/Controller/WorkshopsControllerTest.php +++ b/tests/TestCase/Controller/WorkshopsControllerTest.php @@ -186,21 +186,21 @@ public function testRestWorkshopsBerlin() { $expectedResult = file_get_contents(TESTS . 'comparisons' . DS . 'rest-workshops-berlin.json'); $expectedResult = $this->correctServerName($expectedResult); - $this->get('/api/v1/rest/workshops?city=berlin'); + $this->get('/api/v1/workshops?city=berlin'); $this->assertResponseContains($expectedResult); $this->assertResponseOk(); } public function testRestWorkshopsHamburg() { - $this->get('/api/v1/rest/workshops?city=hamburg'); + $this->get('/api/v1/workshops?city=hamburg'); $this->assertResponseContains('no workshops found'); $this->assertResponseCode(404); } public function testRestWorkshopsWrongParam() { - $this->get('/api/v1/rest/workshops?city=ha'); + $this->get('/api/v1/workshops?city=ha'); $this->assertResponseContains('city not passed or invalid (min 3 chars)'); $this->assertResponseCode(400); }