mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 20:34:03 +00:00
Update ResourceSyncingTest.php
This commit is contained in:
parent
ea21291b3e
commit
3bba3bd3de
1 changed files with 4 additions and 3 deletions
|
|
@ -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 () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue