From 9e08196c76e588b77f2ded36ae7e3aa7b0c7aef9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 23 Apr 2010 21:14:23 -0400 Subject: [PATCH] More tests for ajax link delegation. --- .../cases/libs/view/helpers/paginator.test.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index d2753f577..dc4bbd673 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -1830,7 +1830,7 @@ class PaginatorHelperTest extends CakeTestCase { * * @return void */ - function testAjaxLinkGeneration() { + function testAjaxLinkGenerationNumbers() { $this->Paginator->Js->expectCallCount('link', 2); $result = $this->Paginator->numbers(array( 'modulus'=> '2', @@ -1839,6 +1839,18 @@ class PaginatorHelperTest extends CakeTestCase { )); } +/** + * test that paginatorHelper::link() uses JsHelper to make links when 'update' key is present + * + * @return void + */ + function testAjaxLinkGenerationLink() { + $this->Paginator->Js->expectCallCount('link', 1); + $this->Paginator->Js->setReturnValue('link', 'I am a link'); + $result = $this->Paginator->link('test', array('controller' => 'posts'), array('update' => '#content')); + $this->assertEqual($result, 'I am a link'); + } + /** * test that mock classes injected into paginatorHelper are called when using link() *