Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Aug 22, 2024
1 parent 7206a5c commit 9ef8604
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Laravel/Tests/JsonLdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,9 @@ public function testHidden(): void

public function testVisible(): void
{
$response = $this->get('/api/posts', ['accept' => 'application/ld+json']);
$response = $this->get('/api/books', ['accept' => 'application/ld+json']);
$response->assertStatus(200);
$response->assertHeader('content-type', 'application/ld+json; charset=utf-8');
dump($response->json());
$response->assertJsonMissingPath('internalNote');
$this->assertStringNotContainsString('internalNote', $response->getContent());
}
}
2 changes: 1 addition & 1 deletion src/Laravel/workbench/app/Models/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Book extends Model
use HasFactory;
use HasUlids;

//protected $visible = ['name', 'author', 'isbn', 'publication_date'];
protected $visible = ['name', 'author', 'isbn', 'publication_date'];
protected $fillable = ['name'];

public function author(): BelongsTo
Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/workbench/database/factories/BookFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function definition(): array
'author_id' => AuthorFactory::new(),
'isbn' => fake()->isbn13(),
'publication_date' => fake()->optional()->date(),
'internal_note' => fake()->optional()->text(),
'internal_note' => fake()->text(),
];
}
}

0 comments on commit 9ef8604

Please sign in to comment.