todo front in work
This commit is contained in:
@@ -88,6 +88,50 @@ class ToDoListsTest extends TestCase
|
||||
$response->assertStatus(403);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function a_user_can_retrueved_all_this_to_do_lists()
|
||||
{
|
||||
$this->actingAs($user = factory(User::class)->create(), 'api');
|
||||
$toDoListOne = factory(ToDoList::class)->create(['user_id' => $user->id]);
|
||||
$toDoListTwo = factory(ToDoList::class)->create(['user_id' => $user->id]);
|
||||
|
||||
$response = $this->get('/api/to-do-lists');
|
||||
|
||||
$response->assertJson([
|
||||
'data' => [
|
||||
[
|
||||
'data' => [
|
||||
'to_do_list_id' => $toDoListOne->id,
|
||||
'attributes' => [
|
||||
'data' => [
|
||||
'name' => $toDoListOne->name,
|
||||
'last_updated' => $toDoListOne->updated_at->diffForHumans(),
|
||||
]
|
||||
],
|
||||
],
|
||||
'links' => [
|
||||
'self' => $toDoListOne->path(),
|
||||
]
|
||||
],
|
||||
[
|
||||
'data' => [
|
||||
'to_do_list_id' => $toDoListTwo->id,
|
||||
'attributes' => [
|
||||
'data' => [
|
||||
'name' => $toDoListTwo->name,
|
||||
'last_updated' => $toDoListTwo->updated_at->diffForHumans(),
|
||||
]
|
||||
],
|
||||
],
|
||||
'links' => [
|
||||
'self' => $toDoListTwo->path(),
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function a_to_do_list_can_be_patch()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user