1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 14:54:03 +00:00
This commit is contained in:
Abrar Ahmad 2022-11-23 10:03:25 +05:00
parent 9520cbc811
commit 36afb7dbdd
4 changed files with 29 additions and 0 deletions

View file

@ -34,3 +34,20 @@ test('tenant route helper generates correct url', function () {
expect(tenant_route('foo.localhost', 'foo', ['a' => 'as', 'b' => 'df']))->toBe('http://foo.localhost/abcdef/as/df');
expect(tenant_route('foo.localhost', 'foo', []))->toBe('http://foo.localhost/abcdef');
});
test('redirect from central to tenant works fine', function () {
config([
'tenancy.features' => [CrossDomainRedirect::class],
]);
Route::get('/foobar', function () {
return 'Foo';
})->name('home');
Route::get('/redirect', function () {
return redirect()->route('home')->domain('abcd');
});
pest()->get('/redirect')
->assertRedirect('http://abcd/foobar');
});