mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Slug Driver Support (#2456)
- Support slug drivers for core's sluggable models, easily extends to other models - Add automated testing for affected single-model API routes - Fix nickname selection UI - Serialize slugs as `slug` attribute - Make min search length a constant
This commit is contained in:
@@ -66,6 +66,24 @@ class ShowTest extends TestCase
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function author_can_see_discussion_via_slug()
|
||||
{
|
||||
// Note that here, the slug doesn't actually have to match the real slug
|
||||
// since the default slugging strategy only takes the numerical part into account
|
||||
$response = $this->send(
|
||||
$this->request('GET', '/api/discussions/1-fdsafdsajfsakf', [
|
||||
'authenticatedAs' => 2,
|
||||
])->withQueryParams([
|
||||
'bySlug' => true
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
Reference in New Issue
Block a user