1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00

Change URI prefix order during route cloning (#49)

* Change URI prefix order [ci skip]

* Move route cloning to `$this->app->booted()` [ci skip]

* Delete note about LW v2

* Improve comments/docblock [skip ci]

* Fix comment in test, improve assertion [skip ci]
This commit is contained in:
lukinovec 2024-04-24 22:33:18 +02:00 committed by GitHub
parent 7317d2638a
commit b789f5c561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 53 additions and 47 deletions

View file

@ -258,11 +258,13 @@ test('the clone action prefixes already prefixed routes correctly', function ()
$clonedRouteUrl = route($clonedRouteName, ['tenant' => $tenant = Tenant::create()]);
// The cloned route is prefixed correctly
expect($clonedRoute->getPrefix())->toBe('{tenant}/' . $prefix);
expect($clonedRoute->getPrefix())->toBe("{$prefix}/{tenant}");
expect($clonedRouteUrl)
->toContain('/' . $tenant->getTenantKey() . '/' . $prefix . '/home')
->not()->toContain($prefix . '/' . $tenant->getTenantKey() . '/' . $prefix . '/home');
// Original prefix does not occur in the cloned route's URL
->not()->toContain("/{$prefix}/{$tenant->getTenantKey()}/{$prefix}")
// Route is prefixed correctly
->toBe("http://localhost/{$prefix}/{$tenant->getTenantKey()}/home");
// The cloned route is accessible
pest()->get($clonedRouteUrl)->assertSee('Tenancy initialized.');