From a32f50fd5ecdd0b2223b2a79c712d50066f4c664 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 29 Jan 2016 16:42:04 +0000 Subject: [PATCH] Added a test for reporting incident with component and status --- tests/Api/IncidentTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Api/IncidentTest.php b/tests/Api/IncidentTest.php index cd44ea57..f0ebafc3 100644 --- a/tests/Api/IncidentTest.php +++ b/tests/Api/IncidentTest.php @@ -64,6 +64,24 @@ class IncidentTest extends AbstractApiTestCase $this->assertResponseOk(); } + public function testPostIncidentWithComponentStatus() + { + $component = factory('CachetHQ\Cachet\Models\Component')->create(); + + $this->beUser(); + + $this->post('/api/v1/incidents', [ + 'name' => 'Foo', + 'message' => 'Lorem ipsum dolor sit amet', + 'status' => 1, + 'component_id' => $component->id, + 'component_status' => 1, + 'visible' => 1, + ]); + $this->seeJson(['name' => 'Foo']); + $this->assertResponseOk(); + } + public function testCreateIncidentWithTemplate() { $template = factory('CachetHQ\Cachet\Models\IncidentTemplate')->create();