This commit is contained in:
TakeMeNL
2018-10-09 23:37:03 +02:00
parent a7789dc1a6
commit 201322bb53
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();