Skip to content

Commit

Permalink
Merge pull request #3362 from TakeMeNL/bugfix/3269
Browse files Browse the repository at this point in the history
Resolve #3269
  • Loading branch information
jbrooksuk committed Dec 18, 2018
2 parents cddeac0 + 201322b commit 84fd584
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Bus/Commands/Component/CreateComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 15 additions & 0 deletions tests/Api/ComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ public function test_can_create_component()
$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();
Expand Down

0 comments on commit 84fd584

Please sign in to comment.