From 90110944ff6d0798443e94fb3d864725dc7cce37 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 2 Jun 2015 19:48:09 +0100 Subject: [PATCH] Finish incident API tests --- tests/Api/IncidentTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/Api/IncidentTest.php b/tests/Api/IncidentTest.php index 775c45cd..586df61c 100644 --- a/tests/Api/IncidentTest.php +++ b/tests/Api/IncidentTest.php @@ -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); + } }