Finally fixed the tests.

This commit is contained in:
James Cole
2014-08-09 08:18:07 +02:00
parent ebb28df607
commit eed70cdb62
4 changed files with 96 additions and 21 deletions

View File

@@ -68,8 +68,7 @@ class ChartController extends BaseController
// loop and get array data.
$url = count($accounts) == 1 && is_array($accounts)
? '<a href="' . route('accounts.show', [$account->id]) . '">View more</a>'
:
? '<a href="' . route('accounts.show', [$account->id]) . '">View more</a>' :
'<a href="' . route('accounts.index') . '">View more</a>';
$data = [
'chart_title' => count($accounts) == 1 ? $accounts[0]->name : 'All accounts',
@@ -85,8 +84,9 @@ class ChartController extends BaseController
return Response::json($data);
}
public function homeAccountInfo(Account $account, $day, $month, $year)
public function homeAccountInfo($name, $day, $month, $year)
{
$account = $this->_accounts->findByName($name);
$date = Carbon::createFromDate($year, $month, $day);
$result = $this->_chart->accountDailySummary($account, $date);