This commit is contained in:
Romulus21
2024-04-01 20:16:04 +02:00
parent 73a5cd4e2f
commit a172cdeb37
5 changed files with 53 additions and 5 deletions

View File

@@ -96,9 +96,8 @@ test('an user can update a to do', function () {
$toDo = $toDos[rand(0, 9)];
$response = $this->put('api/todos/'.$toDo->id, ['name' => 'update test']);
$response->assertOk()
$this->put('api/todos/'.$toDo->id, ['name' => 'update test'])
->assertOk()
->assertJson([
'id' => $toDo->id,
'user_id' => $toDo->user_id,
@@ -108,6 +107,15 @@ test('an user can update a to do', function () {
expect(ToDo::find($toDo->id))
->name->toBe('update test');
$this->put('api/todos/'.$toDo->id, ['checked' => true])
->assertOk()
->assertJson([
'id' => $toDo->id,
'user_id' => $toDo->user_id,
'name' => 'update test',
'checked' => now()->format('Y-m-d H:i:s'),
]);
});
test('an user can delete a to do', function () {