First set of new tests.

This commit is contained in:
James Cole
2017-02-12 12:21:44 +01:00
parent 69bd292ed8
commit 018af62826
23 changed files with 2193 additions and 135 deletions

View File

@@ -16,4 +16,65 @@ use Tests\TestCase;
class TransactionControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::index
*/
public function testIndex()
{
$this->be($this->user());
$response = $this->get(route('transactions.index', ['transfer']));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::indexAll
*/
public function testIndexAll()
{
$this->be($this->user());
$response = $this->get(route('transactions.index.all', ['transfer']));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::indexByDate
*/
public function testIndexByDate()
{
$this->be($this->user());
$response = $this->get(route('transactions.index.date', ['transfer', '2016-01-01']));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::reorder
*/
public function testReorder()
{
$data = [
'items' => [],
];
$this->be($this->user());
$response = $this->post(route('transactions.reorder'), $data);
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::show
*/
public function testShow()
{
$this->be($this->user());
$response = $this->get(route('transactions.show', [1]));
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
}