Created
June 11, 2012 04:48
-
-
Save tareko/2908555 to your computer and use it in GitHub Desktop.
Test to see if bad save responds properly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function testAddPostFailedSave() { | |
| //TODO: Fix broken test | |
| $Trades = $this->generate('Trades', array( | |
| 'methods' => array( | |
| '_requestAllowed', | |
| 'saveAssociated' | |
| ), | |
| )); | |
| $Trades->expects($this->any()) | |
| ->method('_requestAllowed') | |
| ->will($this->returnValue(true)); | |
| $Trades->expects($this->any()) | |
| ->method('saveAssociated') | |
| ->will($this->returnValue(false)); | |
| $data = array( | |
| 'Trade' => array( | |
| 'user_id' => 1, | |
| 'shift_id' => 16, | |
| 'status' => 0, | |
| ), | |
| 'TradesDetail' => array( | |
| 0 => array( | |
| 'user_id' => 2 | |
| ), | |
| 1 => array( | |
| 'user_id' => 3) | |
| ) | |
| ); | |
| $result = $this->testAction('/trades/add', array('data' => $data, 'method' => 'post')); | |
| // $this->assertTrue($this->Comments->viewVars['success']); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment