You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
903 B
33 lines
903 B
<?php
|
|
|
|
namespace Tests\Feature\Api\Projects;
|
|
|
|
use Tests\TestCase;
|
|
use App\Entities\Projects\Task;
|
|
use App\Entities\Projects\Project;
|
|
|
|
class ReorderTaskListTest extends TestCase
|
|
{
|
|
/** @test */
|
|
public function admin_can_reorder_task_position()
|
|
{
|
|
$admin = $this->adminUserSigningIn();
|
|
$job = factory(Project::class)->create();
|
|
$task1 = factory(Task::class)->create(['job_id' => $job->id, 'position' => 1]);
|
|
$task2 = factory(Task::class)->create(['job_id' => $job->id, 'position' => 2]);
|
|
|
|
$this->postJson(route('jobs.tasks-reorder', $job), [
|
|
'postData' => $task2->id.','.$task1->id,
|
|
]);
|
|
|
|
$this->seeInDatabase('tasks', [
|
|
'id' => $task1->id,
|
|
'position' => 2,
|
|
]);
|
|
|
|
$this->seeInDatabase('tasks', [
|
|
'id' => $task2->id,
|
|
'position' => 1,
|
|
]);
|
|
}
|
|
}
|