Some code cleanup and fixes.

This commit is contained in:
James Cole
2014-08-10 11:30:14 +02:00
parent c50a9b4b04
commit fbd056104a
27 changed files with 145 additions and 91 deletions

View File

@@ -35,8 +35,8 @@ class PreferencesControllerTest extends TestCase
$viewRange->shouldReceive('getAttribute')->with('data')->andReturn('1M');
$this->_accounts->shouldReceive('getDefault')->andReturn([]);
$this->_helper->shouldReceive('get')->with('viewRange','1M')->andReturn($viewRange);
$this->_helper->shouldReceive('get')->with('frontpageAccounts',[])->andReturn([]);
$this->_helper->shouldReceive('get')->with('viewRange', '1M')->andReturn($viewRange);
$this->_helper->shouldReceive('get')->with('frontpageAccounts', [])->andReturn([]);
$this->action('GET', 'PreferencesController@index');
@@ -45,9 +45,9 @@ class PreferencesControllerTest extends TestCase
public function testPostIndex()
{
$this->_helper->shouldReceive('set')->with('frontpageAccounts',[1]);
$this->_helper->shouldReceive('set')->with('viewRange','1M');
$this->action('POST', 'PreferencesController@postIndex',['frontpageAccounts' => [1],'viewRange' => '1M']);
$this->_helper->shouldReceive('set')->with('frontpageAccounts', [1]);
$this->_helper->shouldReceive('set')->with('viewRange', '1M');
$this->action('POST', 'PreferencesController@postIndex', ['frontpageAccounts' => [1], 'viewRange' => '1M']);
$this->assertResponseStatus(302);
}
}