mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-06 20:37:32 +00:00
27 lines
643 B
PHP
27 lines
643 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class CreateTeamTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_teams_can_be_created(): void
|
|
{
|
|
$this->actingAs($user = User::factory()->withPersonalOrganization()->create());
|
|
|
|
$response = $this->post('/teams', [
|
|
'name' => 'Test Organization',
|
|
]);
|
|
|
|
$this->assertCount(2, $user->fresh()->ownedTeams);
|
|
$this->assertEquals('Test Organization', $user->fresh()->ownedTeams()->latest('id')->first()->name);
|
|
}
|
|
}
|