Increased coverage and fixed a nasty bug.

This commit is contained in:
James Cole
2015-06-05 07:10:51 +02:00
parent d579992c98
commit fea9bc4e7e
10 changed files with 161 additions and 120 deletions

View File

@@ -23,7 +23,7 @@ class NewUserController extends Controller
/**
* @param AccountRepositoryInterface $repository
*
* @return \Illuminate\View\View
* @@return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function index(AccountRepositoryInterface $repository)
{
@@ -45,6 +45,8 @@ class NewUserController extends Controller
/**
* @param NewUserFormRequest $request
* @param AccountRepositoryInterface $repository
*
* @return \Illuminate\Http\RedirectResponse
*/
public function submit(NewUserFormRequest $request, AccountRepositoryInterface $repository)
{
@@ -97,20 +99,8 @@ class NewUserController extends Controller
$creditCard = $repository->store($creditAccount);
// store meta for CC:
AccountMeta::create(
[
'name' => 'ccType',
'data' => 'monthlyFull',
'account_id' => $creditCard->id,
]
);
AccountMeta::create(
[
'name' => 'ccMonthlyPaymentDate',
'data' => Carbon::now()->year . '-01-01',
'account_id' => $creditCard->id,
]
);
AccountMeta::create(['name' => 'ccType', 'data' => 'monthlyFull', 'account_id' => $creditCard->id,]);
AccountMeta::create(['name' => 'ccMonthlyPaymentDate', 'data' => Carbon::now()->year . '-01-01', 'account_id' => $creditCard->id,]);
}
Session::flash('success', 'New account(s) created!');