Expand test code.

This commit is contained in:
James Cole
2017-12-17 18:23:10 +01:00
parent c1e1da12c2
commit c7d4ff6f27
15 changed files with 446 additions and 42 deletions

View File

@@ -35,6 +35,31 @@ use Tests\TestCase;
*/
class UserControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Admin\UserController::delete
*/
public function testDelete()
{
$this->be($this->user());
$response = $this->get(route('admin.users.delete', [1]));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\Admin\UserController::destroy
*/
public function testDestroy()
{
$repository = $this->mock(UserRepositoryInterface::class);
$repository->shouldReceive('destroy')->once();
$this->be($this->user());
$response = $this->post(route('admin.users.destroy', ['2']));
$response->assertStatus(302);
$response->assertSessionHas('success');
}
/**
* @covers \FireflyIII\Http\Controllers\Admin\UserController::edit
*/