Skip to content

Commit

Permalink
remove rest from path
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Feb 5, 2024
1 parent 9679986 commit ade61b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Controller/WorkshopsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ade61b7

Please sign in to comment.