Incident templates cleanup (#2182)

Clean up Incident Templates, supply incident array to them by default
This commit is contained in:
James Brooks
2016-10-14 08:03:19 +01:00
committed by GitHub
parent c2153512d9
commit fe96a00b82
14 changed files with 124 additions and 157 deletions
+4 -6
View File
@@ -130,20 +130,18 @@ class IncidentTest extends AbstractApiTestCase
public function testPutIncidentWithTemplate()
{
$this->beUser();
$template = factory('CachetHQ\Cachet\Models\IncidentTemplate')->create();
$template = factory('CachetHQ\Cachet\Models\IncidentTemplate')->create([
'template' => 'Hello there this is a foo in my {{ incident.name }}!',
]);
$component = factory('CachetHQ\Cachet\Models\Incident')->create();
$this->put('/api/v1/incidents/1', [
'name' => 'Foo',
'template' => $template->slug,
'vars' => [
'name' => 'Foo',
'message' => 'Hello there this is a foo!',
],
]);
$this->seeJson([
'name' => 'Foo',
'message' => "Name: Foo,\nMessage: Hello there this is a foo!",
'message' => 'Hello there this is a foo in my Foo!',
]);
$this->assertResponseOk();
}