Skip to content
Browse files

updating controller and integration test to work with current api

  • Loading branch information...
1 parent 7481031 commit 71d692787cfb93218cc7e03e35fe57c9bd8db5a6 @alkemann alkemann committed Jan 5, 2010
Showing with 3 additions and 3 deletions.
  1. +1 −1 controllers/PastesController.php
  2. +2 −2 tests/integration/PasteTest.php
View
2 controllers/PastesController.php
@@ -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');
View
4 tests/integration/PasteTest.php
@@ -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'));
}
@@ -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');

0 comments on commit 71d6927

Please sign in to comment.
Something went wrong with that request. Please try again.