Finish incident API tests

This commit is contained in:
James Brooks
2015-06-02 19:48:09 +01:00
parent f94a5ec57b
commit 90110944ff

View File

@@ -54,4 +54,32 @@ class IncidentTest extends AbstractTestCase
]);
$this->seeJson(['name' => 'Foo']);
}
public function testGetNewIncident()
{
$incident = factory('CachetHQ\Cachet\Models\Incident')->create();
$this->get('/api/v1/incidents/1');
$this->seeJson(['name' => $incident->name]);
}
public function testPutIncident()
{
$this->beUser();
$component = factory('CachetHQ\Cachet\Models\Incident')->create();
$this->put('/api/v1/incidents/1', [
'name' => 'Foo',
]);
$this->seeJson(['name' => 'Foo']);
}
public function testDeleteIncident()
{
$this->beUser();
$component = factory('CachetHQ\Cachet\Models\Incident')->create();
$this->delete('/api/v1/incidents/1');
$this->assertResponseStatus(204);
}
}