mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
Added configurable API throttling, Handled API errors standardly
This commit is contained in:
@@ -38,6 +38,26 @@ class BooksApiTest extends TestCase
|
||||
$this->assertActivityExists('book_create', $newItem);
|
||||
}
|
||||
|
||||
public function test_book_name_needed_to_create()
|
||||
{
|
||||
$this->actingAsApiEditor();
|
||||
$details = [
|
||||
'description' => 'A book created via the API',
|
||||
];
|
||||
|
||||
$resp = $this->postJson($this->baseEndpoint, $details);
|
||||
$resp->assertStatus(422);
|
||||
$resp->assertJson([
|
||||
"error" => [
|
||||
"message" => "The given data was invalid.",
|
||||
"validation" => [
|
||||
"name" => ["The name field is required."]
|
||||
],
|
||||
"code" => 422,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_read_endpoint()
|
||||
{
|
||||
$this->actingAsApiEditor();
|
||||
|
Reference in New Issue
Block a user