Fix tests for current feature set.

This commit is contained in:
James Cole
2018-10-27 05:39:11 +02:00
parent 970cc91938
commit c0ab0b5af5
3 changed files with 47 additions and 19 deletions

View File

@@ -93,6 +93,8 @@ class JobStatusControllerTest extends TestCase
$job->file_type = '';
$job->save();
$importRepos->shouldReceive('countTransactions')->once()->andReturn(0);
// call thing.
$this->be($this->user());
$response = $this->get(route('import.job.status.json', [$job->key]));
@@ -120,6 +122,8 @@ class JobStatusControllerTest extends TestCase
$job->tag()->associate($tag);
$job->save();
$importRepos->shouldReceive('countTransactions')->once()->andReturn(0);
// call thing.
$this->be($this->user());
$response = $this->get(route('import.job.status.json', [$job->key]));
@@ -143,6 +147,8 @@ class JobStatusControllerTest extends TestCase
$second = $this->user()->transactionJournals()->where('id', '!=', $journal->id)->first();
$tag->transactionJournals()->sync([$journal->id, $second->id]);
$importRepos->shouldReceive('countTransactions')->once()->andReturn(2);
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = 'Dfake_job_' . random_int(1, 10000);
@@ -175,6 +181,8 @@ class JobStatusControllerTest extends TestCase
$journal = $this->user()->transactionJournals()->first();
$tag->transactionJournals()->sync([$journal->id]);
$importRepos->shouldReceive('countTransactions')->once()->andReturn(1);
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = 'Efake_job_' . random_int(1, 10000);