Improve test coverage.

This commit is contained in:
James Cole
2017-03-21 20:46:14 +01:00
parent ab9146b7c6
commit 477acafc4c
2 changed files with 66 additions and 43 deletions

View File

@@ -43,8 +43,30 @@ class NewUserControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\NewUserController::index
* @covers \FireflyIII\Http\Controllers\NewUserController::__construct
*/
public function testIndexExisting()
{
// mock stuff
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('count')->andReturn(1);
$this->be($this->user());
$response = $this->get(route('new-user.index'));
$response->assertStatus(302);
$response->assertRedirect(route('index'));
}
/**
* @covers \FireflyIII\Http\Controllers\NewUserController::submit
* @covers \FireflyIII\Http\Controllers\NewUserController::createAssetAccount
* @covers \FireflyIII\Http\Controllers\NewUserController::createSavingsAccount
* @covers \FireflyIII\Http\Controllers\NewUserController::storeCreditCard
*/
public function testSubmit()
{