feat: add category management
associate with entries and text widgets
This commit is contained in:
parent
c83028b4d4
commit
9b9e1a8e29
22 changed files with 392 additions and 46 deletions
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Entry;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use App\Models\User;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ test('can list entries', function () {
|
|||
$response = $this->actingAs($user)->getJson('/api/entries');
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonCount(3);
|
||||
->assertJsonCount(3, 'data');
|
||||
});
|
||||
|
||||
test('can create an entry', function () {
|
||||
|
|
@ -30,7 +30,7 @@ test('can create an entry', function () {
|
|||
$response = $this->postJson('/api/entries', $data);
|
||||
|
||||
$response->assertCreated()
|
||||
->assertJsonFragment($data);
|
||||
->assertJsonFragment($data);
|
||||
});
|
||||
|
||||
test('can show an entry', function () {
|
||||
|
|
@ -40,7 +40,7 @@ test('can show an entry', function () {
|
|||
$response = $this->actingAs($user)->getJson("/api/entries/{$entry->id}");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonFragment(['id' => $entry->id]);
|
||||
->assertJsonFragment(['id' => $entry->id]);
|
||||
});
|
||||
|
||||
test('can update an entry', function () {
|
||||
|
|
@ -51,7 +51,7 @@ test('can update an entry', function () {
|
|||
$response = $this->actingAs($user)->putJson("/api/entries/{$entry->id}", $data);
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonFragment($data);
|
||||
->assertJsonFragment($data);
|
||||
});
|
||||
|
||||
test('can delete an entry', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue