fix tests
This commit is contained in:
@@ -8,7 +8,7 @@ test('user can start a time tracker', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
$toDo = ToDo::factory()->create(['user_id' => $user->id, 'checked' => false]);
|
||||
|
||||
$this->postJson('/api/time-tracker', ['todo_id' => $toDo->id])
|
||||
$this->postJson('/api/time-trackers', ['todo_id' => $toDo->id])
|
||||
->assertCreated()
|
||||
->assertJson([
|
||||
'id' => $toDo->timeTrackers()->value('id'),
|
||||
@@ -27,10 +27,10 @@ test('user can retrieve his current timer', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
$toDo = ToDo::factory()->create(['user_id' => $user->id, 'checked' => false]);
|
||||
|
||||
$this->postJson('/api/time-tracker', ['todo_id' => $toDo->id])
|
||||
$this->postJson('/api/time-trackers', ['todo_id' => $toDo->id])
|
||||
->assertCreated();
|
||||
|
||||
$this->get('/api/time-tracker/user')
|
||||
$this->get('/api/time-trackers/user')
|
||||
->assertOk()
|
||||
->assertJson([
|
||||
'id' => $toDo->timeTrackers()->value('id'),
|
||||
@@ -48,7 +48,7 @@ test('user can retrieve his current timer', function () {
|
||||
test('user has no content response if not current time tracker', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
|
||||
$this->get('/api/time-tracker/user')
|
||||
$this->get('/api/time-trackers/user')
|
||||
->assertNoContent();
|
||||
});
|
||||
|
||||
@@ -56,10 +56,10 @@ test('user can stop current time tracker', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
$toDo = ToDo::factory()->create(['user_id' => $user->id, 'checked' => false]);
|
||||
|
||||
$this->postJson('/api/time-tracker', ['todo_id' => $toDo->id])
|
||||
$this->postJson('/api/time-trackers', ['todo_id' => $toDo->id])
|
||||
->assertCreated();
|
||||
|
||||
$this->delete('/api/time-tracker/user')
|
||||
$this->delete('/api/time-trackers/user')
|
||||
->assertNoContent();
|
||||
|
||||
expect($toDo->timeTrackers->first())
|
||||
|
||||
Reference in New Issue
Block a user