@@ -63,8 +63,8 @@ beforeEach(function () {
|
||||
|
||||
test('an unassigned account can create an isolated company and becomes its administrator', function () {
|
||||
$user = User::factory()->create();
|
||||
$this->actingAs($user)->post('/empresa/iniciar', ['name' => 'Nova empresa', 'department' => 'Geral'])->assertRedirect('/dashboard');
|
||||
expect($user->refresh()->purchasing_role)->toBe(PurchasingRole::Admin);
|
||||
$this->actingAs($user)->post('/empresa/iniciar', ['name' => 'Nova empresa', 'department' => 'Geral', 'first_limit' => '1000.00', 'second_limit' => '2000.00', 'includes_tax' => true, 'second_name' => 'Segundo administrador QA', 'second_email' => 'segundo-admin-qa@example.test', 'second_password' => 'Example-password-234!', 'second_password_confirmation' => 'Example-password-234!'])->assertRedirect('/dashboard');
|
||||
expect($user->refresh()->hasFunctions(['admin']))->toBeTrue()->and($user->purchasing_role)->toBe(PurchasingRole::Configured);
|
||||
expect($user->tenant_id)->not->toBe($this->tenant->id);
|
||||
$this->actingAs($user)->post('/empresa/iniciar', ['name' => 'Outra empresa', 'department' => 'Geral'])->assertForbidden();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user