Started work on enabling/disabling components

This commit is contained in:
James Brooks
2015-11-03 21:32:45 +00:00
parent e8a3e18d55
commit edd111451e
10 changed files with 122 additions and 14 deletions

View File

@@ -61,11 +61,45 @@ class ComponentTest extends AbstractTestCase
'link' => 'http://example.com',
'order' => 1,
'group_id' => 1,
'enabled' => true,
]);
$this->seeJson(['name' => 'Foo']);
$this->assertResponseOk();
}
public function testPostComponentWithoutEnabledField()
{
$this->beUser();
$this->post('/api/v1/components', [
'name' => 'Foo',
'description' => 'Bar',
'status' => 1,
'link' => 'http://example.com',
'order' => 1,
'group_id' => 1,
]);
$this->seeJson(['name' => 'Foo', 'enabled' => true]);
$this->assertResponseOk();
}
public function testPostDisabledComponent()
{
$this->beUser();
$this->post('/api/v1/components', [
'name' => 'Foo',
'description' => 'Bar',
'status' => 1,
'link' => 'http://example.com',
'order' => 1,
'group_id' => 1,
'enabled' => 0,
]);
$this->seeJson(['name' => 'Foo', 'enabled' => false]);
$this->assertResponseOk();
}
public function testGetNewComponent()
{
$component = factory('CachetHQ\Cachet\Models\Component')->create();