add test
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user