Finish Component API testing

This commit is contained in:
James Brooks
2015-06-02 19:44:17 +01:00
parent 9de5847004
commit 4245b95406
2 changed files with 34 additions and 3 deletions

View File

@@ -60,11 +60,31 @@ class ComponentTest extends AbstractTestCase
$this->seeJson(['name' => 'Foo']);
}
/*public function testGetNewComponent()
public function testGetNewComponent()
{
$this->beUser();
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
$this->get('/api/v1/components/1');
$this->seeJson(['name' => $incident->name]);
}
public function testPutComponent()
{
$this->beUser();
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
$this->put('/api/v1/components/1', [
'name' => 'Foo',
]);
$this->seeJson(['name' => 'Foo']);
}*/
}
public function testDeleteComponent()
{
$this->beUser();
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
$this->delete('/api/v1/components/1');
$this->assertResponseStatus(204);
}
}