Added letUserBeLoggedIn for CompoentTest (doesn't fully work)
This commit is contained in:
@@ -18,6 +18,15 @@ class ComponentTest extends AbstractTestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
|
||||
/**
|
||||
* @before
|
||||
*/
|
||||
public function letUserBeLoggedIn()
|
||||
{
|
||||
$user = factory('CachetHQ\Cachet\Models\User')->create();
|
||||
$this->be($user);
|
||||
}
|
||||
|
||||
public function testGetComponents()
|
||||
{
|
||||
$this->get('/api/v1/components')->seeJson(['data' => []]);
|
||||
@@ -35,4 +44,9 @@ class ComponentTest extends AbstractTestCase
|
||||
$this->post('/api/v1/components');
|
||||
$this->assertResponseStatus(401);
|
||||
}
|
||||
|
||||
public function testPostComponentAuthorizedNoData()
|
||||
{
|
||||
$this->actingAs($this->user)->post('/api/v1/components')->seeJson(['Hello']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user