Commit: 463a02cafa87402d0714d935a9295d418eb20be6

Author: alkemann | Date: 2009-12-07 21:32:04 +0100
fixed find('count') finder in `Paste` to work with tests and fixed integration tests
diff --git a/models/Paste.php b/models/Paste.php index 2254b13..fce117e 100644 --- a/models/Paste.php +++ b/models/Paste.php @@ -83,7 +83,7 @@ class Paste extends \lithium\data\Model { 'host' => '127.0.0.1', 'port' => '5984' )); - $result = json_decode($http->get('/'.Paste::meta('source').'/_design/paste/_view/count')); + $result = json_decode($http->get('/'.$self::meta('source').'/_design/paste/_view/count')); return $result->total_rows; }; Paste::applyFilter('save', function($self, $params, $chain) { diff --git a/tests/integration/PasteTest.php b/tests/integration/PasteTest.php index 30f38fa..3aa10c9 100644 --- a/tests/integration/PasteTest.php +++ b/tests/integration/PasteTest.php @@ -134,7 +134,7 @@ class PasteTest extends \lithium\test\Unit { public function testCount() { $this->_tasks(array('PutTable','FillTableFull')); - $expected = 9; + $expected = 11; $result = MockIntegrationPaste::find('count'); $this->assertEqual($expected, $result); @@ -151,6 +151,7 @@ class PasteTest extends \lithium\test\Unit { protected function _taskPutTable() { Connections::get("test")->put('/test_pastes'); + MockIntegrationPasteView::create()->save(); } protected function _taskDeleteTable() { @@ -169,6 +170,7 @@ class PasteTest extends \lithium\test\Unit { $paste = MockIntegrationPaste::create($data); $paste->save(); } + protected function _taskFillTableFull() { $data = array( 'id' => 'a1',