From bd08979e0c91a9d23b2e02a1d73bd7418c7fdadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sat, 21 Sep 2019 17:29:26 +0200 Subject: [PATCH] global_asset test --- tests/TenantAssetTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/TenantAssetTest.php b/tests/TenantAssetTest.php index 4b092b5a..66e00cc8 100644 --- a/tests/TenantAssetTest.php +++ b/tests/TenantAssetTest.php @@ -55,5 +55,15 @@ class TenantAssetTest extends TestCase $this->assertSame("https://an-s3-bucket/tenant{$tenant->id}/foo", asset('foo')); } - // todo test global asset + /** @test */ + public function global_asset_helper_returns_the_same_url_regardless_of_tenancy_initialization() + { + $original = global_asset('foobar'); + $this->assertSame(asset('foobar'), global_asset('foobar')); + + Tenant::create(['foo.localhost']); + tenancy()->init('foo.localhost'); + + $this->assertSame($original, global_asset('foobar')); + } }