All code for reminders based on piggy banks. I hope.

This commit is contained in:
James Cole
2014-08-23 22:32:12 +02:00
parent d56c00915c
commit 6e17c805c2
28 changed files with 652 additions and 44 deletions

View File

@@ -311,6 +311,13 @@ class PiggybankControllerTest extends TestCase
public function teststorePiggybank()
{
$piggy = f::create('Piggybank');
$piggy->repeats = 0;
$piggy->save();
Event::shouldReceive('fire')->with('piggybanks.storePiggy',[$piggy])->once();
//Event::fire('piggybanks.storePiggy',[$piggyBank]);
//Event::fire('piggybanks.storeRepeated',[$piggyBank]);
$this->_piggybanks->shouldReceive('store')->once()->andReturn($piggy);
$this->action('POST', 'PiggybankController@storePiggybank');
$this->assertResponseStatus(302);
@@ -319,6 +326,9 @@ class PiggybankControllerTest extends TestCase
public function testStoreRepeated()
{
$piggy = f::create('Piggybank');
$piggy->repeats = 1;
$piggy->save();
Event::shouldReceive('fire')->with('piggybanks.storeRepeated',[$piggy])->once();
$this->_piggybanks->shouldReceive('store')->once()->andReturn($piggy);
$this->action('POST', 'PiggybankController@storeRepeated');
$this->assertResponseStatus(302);