Incident templates cleanup (#2182)
Clean up Incident Templates, supply incident array to them by default
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ReportIncidentCommandTest extends AbstractTestCase
|
||||
'stickied' => false,
|
||||
'incident_date' => null,
|
||||
'template' => null,
|
||||
'template_vars' => null,
|
||||
'template_vars' => [],
|
||||
];
|
||||
|
||||
$object = new ReportIncidentCommand(
|
||||
|
||||
@@ -41,7 +41,7 @@ class UpdateIncidentCommandTest extends AbstractTestCase
|
||||
'stickied' => false,
|
||||
'incident_date' => null,
|
||||
'template' => null,
|
||||
'template_vars' => null,
|
||||
'template_vars' => [],
|
||||
];
|
||||
|
||||
$object = new UpdateIncidentCommand(
|
||||
|
||||
Reference in New Issue
Block a user