mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Added extension system
This commit is contained in:
@@ -45,6 +45,7 @@ class MemberEndpointTest extends ApiEndpointTestAbstract
|
||||
]));
|
||||
|
||||
// Assert
|
||||
$response->assertValid();
|
||||
$response->assertStatus(204);
|
||||
}
|
||||
|
||||
|
||||
34
tests/Unit/Endpoint/Web/HomeEndpointTest.php
Normal file
34
tests/Unit/Endpoint/Web/HomeEndpointTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Endpoint\Web;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class HomeEndpointTest extends EndpointTestAbstract
|
||||
{
|
||||
public function test_index_redirects_to_dashboard_if_user_is_logged_in(): void
|
||||
{
|
||||
// Arrange
|
||||
$user = User::factory()->withPersonalOrganization()->create();
|
||||
$this->actingAs($user);
|
||||
|
||||
// Act
|
||||
$response = $this->get('/');
|
||||
|
||||
// Assert
|
||||
$response->assertRedirect('/dashboard');
|
||||
}
|
||||
|
||||
public function test_index_redirects_to_login_if_user_is_not_logged_in(): void
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
$response = $this->get('/');
|
||||
|
||||
// Assert
|
||||
$response->assertRedirect('/login');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user