Adds the ability to set the default view in which to display metrics

This commit is contained in:
James Brooks
2015-12-26 16:43:22 +00:00
parent 0d406b8360
commit 1c27cf7360
16 changed files with 152 additions and 28 deletions

View File

@@ -61,6 +61,7 @@ class MetricTest extends AbstractApiTestCase
'default_value' => 1,
'display_chart' => 1,
'places' => 0,
'view' => 0,
]);
$this->seeJson(['name' => 'Foo']);
$this->assertResponseOk();
@@ -82,8 +83,9 @@ class MetricTest extends AbstractApiTestCase
$this->put('/api/v1/metrics/1', [
'name' => 'Foo',
'view' => 2,
]);
$this->seeJson(['name' => 'Foo']);
$this->seeJson(['name' => 'Foo', 'default_view' => 2]);
$this->assertResponseOk();
}

View File

@@ -36,6 +36,7 @@ class AddMetricCommandTest extends AbstractTestCase
'calc_type' => 0,
'display_chart' => 1,
'places' => 0,
'default_view' => 0,
];
$object = new AddMetricCommand(
@@ -45,7 +46,8 @@ class AddMetricCommandTest extends AbstractTestCase
$params['default_value'],
$params['calc_type'],
$params['display_chart'],
$params['places']
$params['places'],
$params['default_view']
);
return compact('params', 'object');

View File

@@ -38,6 +38,7 @@ class UpdateMetricCommandTest extends AbstractTestCase
'calc_type' => 0,
'display_chart' => 1,
'places' => 0,
'default_view' => 0,
];
$object = new UpdateMetricCommand(
@@ -48,7 +49,8 @@ class UpdateMetricCommandTest extends AbstractTestCase
$params['default_value'],
$params['calc_type'],
$params['display_chart'],
$params['places']
$params['places'],
$params['default_view']
);
return compact('params', 'object');