mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 04:34:03 +00:00
Revert changes in test
This commit is contained in:
parent
8254b9b7b7
commit
0c41b3ba85
1 changed files with 3 additions and 5 deletions
|
|
@ -113,12 +113,12 @@ afterEach(function () {
|
|||
UpdateOrCreateSyncedResource::$scopeGetModelQuery = null;
|
||||
});
|
||||
|
||||
test('creating multiple tenant resources with the same global_id only creates corresponding central resource if it does not exist yet', function () {
|
||||
test('resources created with the same global id in different tenant dbs will be synced to a single central resource', function () {
|
||||
$tenants = [Tenant::create(), Tenant::create(), Tenant::create()];
|
||||
migrateUsersTableForTenants();
|
||||
|
||||
// While creating a tenant resource with global_id 'acme',
|
||||
// a corresponding central resource is attempted to be created ONLY ONCE.
|
||||
// Only a single central user is created since the same global_id is used for each tenant user
|
||||
// Therefore all of these tenant users are synced to a single global user
|
||||
tenancy()->runForMultiple($tenants, function () {
|
||||
// Create a user with the same global_id in each tenant DB
|
||||
TenantUser::create([
|
||||
|
|
@ -130,8 +130,6 @@ test('creating multiple tenant resources with the same global_id only creates co
|
|||
]);
|
||||
});
|
||||
|
||||
// Only a single central user is created.
|
||||
// No duplicate global_id exception is thrown.
|
||||
expect(CentralUser::all())->toHaveCount(1);
|
||||
expect(CentralUser::first()->global_id)->toBe('acme');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue