users and institutions route, tests fixed
This commit is contained in:
37
backend/tests/Feature/UserPositionSeederTest.php
Normal file
37
backend/tests/Feature/UserPositionSeederTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Lists\UserPosition;
|
||||
use Database\Seeders\UserPositionSeeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UserPositionSeederTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_it_seeds_the_base_positions(): void
|
||||
{
|
||||
$this->seed(UserPositionSeeder::class);
|
||||
|
||||
$this->assertSame(5, UserPosition::count());
|
||||
foreach ([
|
||||
UserPosition::PROFESSOR,
|
||||
UserPosition::RESEARCHER,
|
||||
UserPosition::PHD,
|
||||
UserPosition::STUDENT,
|
||||
UserPosition::ADMINISTRATIVE,
|
||||
] as $value) {
|
||||
$this->assertDatabaseHas('user_positions', ['value' => $value]);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_it_is_idempotent(): void
|
||||
{
|
||||
$this->seed(UserPositionSeeder::class);
|
||||
$this->seed(UserPositionSeeder::class);
|
||||
|
||||
$this->assertSame(5, UserPosition::count());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user