Skip to content

Commit

Permalink
Fixed issue 23 where GridFieldSortableRowsTest would fail because the…
Browse files Browse the repository at this point in the history
… name of the request variable changed from Items to ItemIDs
  • Loading branch information
UndefinedOffset committed Jan 22, 2013
1 parent ee001c3 commit d4e8ba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/forms/GridFieldSortableRowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testSortActionWithoutCorrectPermission() {

$stateID = 'testGridStateActionField';
Session::set($stateID, array('grid'=>'', 'actionName'=>'saveGridRowSort', 'args'=>array('GridFieldSortableRows'=>array('sortableToggle'=>true))));
$request = new SS_HTTPRequest('POST', 'url', array('Items'=>'1,3,2'), array('action_gridFieldAlterAction?StateID='.$stateID=>true));
$request = new SS_HTTPRequest('POST', 'url', array('ItemIDs'=>'1,3,2'), array('action_gridFieldAlterAction?StateID='.$stateID=>true));
$this->gridField->gridFieldAlterAction(array('StateID'=>$stateID), $this->form, $request);
$this->assertEquals(3, $this->list->last()->ID, 'User should\'t be able to sort records without correct permissions.');
}
Expand All @@ -39,7 +39,7 @@ public function testSortActionWithAdminPermission() {
$this->logInWithPermission('ADMIN');
$stateID = 'testGridStateActionField';
Session::set($stateID, array('grid'=>'', 'actionName'=>'saveGridRowSort', 'args'=>array('GridFieldSortableRows'=>array('sortableToggle'=>true))));
$request = new SS_HTTPRequest('POST', 'url', array('Items'=>'1,3,2'), array('action_gridFieldAlterAction?StateID='.$stateID=>true));
$request = new SS_HTTPRequest('POST', 'url', array('ItemIDs'=>'1,3,2'), array('action_gridFieldAlterAction?StateID='.$stateID=>true));
$this->gridField->gridFieldAlterAction(array('StateID'=>$stateID), $this->form, $request);
$this->assertEquals(2, $this->list->last()->ID, 'User should be able to sort records with ADMIN permission.');
}
Expand Down

0 comments on commit d4e8ba6

Please sign in to comment.