Fix tests.

This commit is contained in:
James Cole
2018-08-17 06:45:57 +02:00
parent df0e2dd2a2
commit f319005357
11 changed files with 46 additions and 70 deletions

View File

@@ -112,10 +112,12 @@ class HelpControllerTest extends TestCase
$help->shouldReceive('inCache')->withArgs(['index', 'en_US'])->andReturn(false)->once();
$help->shouldReceive('getFromGithub')->withArgs(['index', 'en_US'])->andReturn('')->once();
$help->shouldReceive('putInCache')->once();
$this->be($this->user());
$response = $this->get(route('help.show', ['index']));
$response->assertStatus(200);
$response->assertSee('Er is geen hulptekst voor deze pagina.'); // Dutch
$response->assertSee('Deze helptekst is nog niet beschikbaar in het Nederlands.'); // Dutch
// put English back:
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();

View File

@@ -564,6 +564,7 @@ class ReportControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
/** @var Tag $tag */
$tag = $this->user()->tags()->find(1);
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('findNull')->andReturn($this->user()->accounts()->find(1))->twice();
@@ -579,7 +580,7 @@ class ReportControllerTest extends TestCase
$this->be($this->user());
$response = $this->post(route('reports.index.post'), $data);
$response->assertStatus(302);
$response->assertRedirect(route('reports.report.tag', ['1', $tag->tag, '20160101', '20160131']));
$response->assertRedirect(route('reports.report.tag', ['1', $tag->id, '20160101', '20160131']));
}
/**