Finish Component API testing
This commit is contained in:
@@ -20,3 +20,14 @@ $factory->define('CachetHQ\Cachet\Models\User', function ($faker) {
|
||||
'level' => 1,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define('CachetHQ\Cachet\Models\Component', function ($faker) {
|
||||
return [
|
||||
'name' => $faker->sentence(),
|
||||
'description' => $faker->paragraph(),
|
||||
'link' => $faker->url(),
|
||||
'status' => 1,
|
||||
'order' => 0,
|
||||
'user_id' => 1,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -60,11 +60,31 @@ class ComponentTest extends AbstractTestCase
|
||||
$this->seeJson(['name' => 'Foo']);
|
||||
}
|
||||
|
||||
/*public function testGetNewComponent()
|
||||
public function testGetNewComponent()
|
||||
{
|
||||
$this->beUser();
|
||||
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
|
||||
|
||||
$this->get('/api/v1/components/1');
|
||||
$this->seeJson(['name' => $incident->name]);
|
||||
}
|
||||
|
||||
public function testPutComponent()
|
||||
{
|
||||
$this->beUser();
|
||||
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
|
||||
|
||||
$this->put('/api/v1/components/1', [
|
||||
'name' => 'Foo',
|
||||
]);
|
||||
$this->seeJson(['name' => 'Foo']);
|
||||
}*/
|
||||
}
|
||||
|
||||
public function testDeleteComponent()
|
||||
{
|
||||
$this->beUser();
|
||||
$incident = factory('CachetHQ\Cachet\Models\Component')->create();
|
||||
|
||||
$this->delete('/api/v1/components/1');
|
||||
$this->assertResponseStatus(204);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user