Skip to content

Commit

Permalink
updating controller and integration test to work with current api
Browse files Browse the repository at this point in the history
  • Loading branch information
alkemann committed Jan 5, 2010
1 parent 7481031 commit 71d6927
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/PastesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function index() {
*/
public function view($id = null) {
$paste = Paste::find($id);
if ($paste == null) {
if ($paste->rewind() == 'not_found') {
$this->redirect(array('controller' => 'pastes', 'action' => 'index'));
}
return compact('paste');
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/PasteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testReadNotFound() {

$result = MockIntegrationPaste::find('abcd1');

$this->assertFalse($result->exists());
$this->assertTrue($result->rewind() == 'not_found');

$this->_tasks(array('DeleteTable'));
}
Expand All @@ -83,7 +83,7 @@ public function testLatestView() {
'limit' => '10',
'descending' => 'true'
)));
$this->assertFalse($latest->exists());
$this->assertFalse($latest->rewind() == 'not_found');

$viewSave = MockIntegrationPasteView::create()->save();
$this->skipIf(!$viewSave, 'Failed to save view. Tests skipped');
Expand Down

0 comments on commit 71d6927

Please sign in to comment.