1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 13:34:04 +00:00

Update ResourceSyncingTest.php

This commit is contained in:
Abrar Ahmad 2022-08-10 13:41:14 +05:00
parent ea21291b3e
commit 3bba3bd3de

View file

@ -126,7 +126,7 @@ test('only the synced columns are updated in the central db', function () {
], ResourceUser::first()->getAttributes()); ], ResourceUser::first()->getAttributes());
}); });
test('creating the resource in tenant database creates it in central database and used custom attributes', function () { test('creating the resource in tenant database creates it in central database with provided attribute', function () {
// Assert no user exists in central DB // Assert no user exists in central DB
expect(ResourceUser::all())->toHaveCount(0); expect(ResourceUser::all())->toHaveCount(0);
@ -138,7 +138,7 @@ test('creating the resource in tenant database creates it in central database an
tenancy()->initialize($tenant); tenancy()->initialize($tenant);
// Create the same user in tenant DB // Create the user in tenant DB
ResourceUser::create([ ResourceUser::create([
'global_id' => 'acme', 'global_id' => 'acme',
'name' => 'John Doe', 'name' => 'John Doe',
@ -150,8 +150,9 @@ test('creating the resource in tenant database creates it in central database an
tenancy()->end(); tenancy()->end();
// assert user was created // Assert central user was created without `code` property
expect(CentralUser::first()->global_id)->toBe('acme'); expect(CentralUser::first()->global_id)->toBe('acme');
expect(CentralUser::first()->code)->toBeNull();
}); });
test('creating the resource in tenant database creates it in central database and creates the mapping', function () { test('creating the resource in tenant database creates it in central database and creates the mapping', function () {