Files
solidtime/tests/Feature/CreateTeamTest.php
T
2024-01-21 19:52:19 +01:00

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);
}
}