adrema/tests/Feature/Activity/CreateTest.php

31 lines
775 B
PHP
Raw Permalink Normal View History

2023-02-25 18:00:23 +01:00
<?php
namespace Tests\Feature\Activity;
use App\Subactivity;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class CreateTest extends TestCase
{
use DatabaseTransactions;
public function testItCreatesAnActivity(): void
{
$this->login()->loginNami()->withoutExceptionHandling();
Subactivity::factory()->name('Pupu')->create();
$response = $this->get(route('activity.create'));
$this->assertInertiaHas([
'name' => '',
2023-03-04 12:09:25 +01:00
'is_filterable' => false,
2023-02-25 18:00:23 +01:00
'subactivities' => [],
], $response, 'data');
$this->assertInertiaHas([
'id' => Subactivity::first()->id,
'name' => 'Pupu',
], $response, 'meta.subactivities.0');
}
}