1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:14:03 +00:00

remove irrelevant assertions

This commit is contained in:
Samuel Štancl 2022-08-31 19:48:51 +02:00 committed by GitHub
parent f69bc2add0
commit a4aea29303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,7 +184,6 @@ test('run command works when sub command asks questions and accepts arguments',
$tenant = Tenant::create(); $tenant = Tenant::create();
$id = $tenant->getTenantKey(); $id = $tenant->getTenantKey();
// Run tenant migrations so we have users table
Artisan::call('tenants:migrate'); Artisan::call('tenants:migrate');
pest()->artisan("tenants:run --tenants=$id 'user:addwithname Abrar' ") pest()->artisan("tenants:run --tenants=$id 'user:addwithname Abrar' ")
@ -195,15 +194,11 @@ test('run command works when sub command asks questions and accepts arguments',
// Assert we are in central context // Assert we are in central context
expect(tenancy()->initialized)->toBeFalse(); expect(tenancy()->initialized)->toBeFalse();
// Assert users table does not exist in the central context // Assert user was created in tenant context
expect(Schema::hasTable('users'))->toBeFalse();
// Assert user created in tenant context
tenancy()->initialize($tenant); tenancy()->initialize($tenant);
expect(Schema::hasTable('users'))->toBeTrue();
$user = User::first(); $user = User::first();
// Assert user is same as provided using command // Assert user is same as provided using the command
expect($user->name)->toBe('Abrar'); expect($user->name)->toBe('Abrar');
expect($user->email)->toBe('email@localhost'); expect($user->email)->toBe('email@localhost');
}); });