Merge pull request #3362 from TakeMeNL/bugfix/3269

Resolve #3269
This commit is contained in:
James Brooks
2018-12-18 08:21:11 +00:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ final class CreateComponentCommand
*/
public $rules = [
'name' => 'required|string',
'description' => 'required|string',
'description' => 'nullable|string',
'status' => 'required|int|min:0|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',

View File

@@ -84,6 +84,21 @@ class ComponentTest extends AbstractApiTestCase
$response->assertJsonFragment(['name' => 'Foo']);
}
public function test_can_create_minimal_component()
{
$this->beUser();
$this->expectsEvents(ComponentWasCreatedEvent::class);
$response = $this->json('POST', '/api/v1/components', [
'name' => 'Foo',
'status' => 1,
]);
$response->assertStatus(200);
$response->assertJsonFragment(['name' => 'Foo']);
}
public function test_can_create_component_without_enabled_field()
{
$this->beUser();