More tests for ajax link delegation.

This commit is contained in:
Mark Story 2010-04-23 21:14:23 -04:00
parent bf566e1aad
commit 9e08196c76

View file

@ -1830,7 +1830,7 @@ class PaginatorHelperTest extends CakeTestCase {
* *
* @return void * @return void
*/ */
function testAjaxLinkGeneration() { function testAjaxLinkGenerationNumbers() {
$this->Paginator->Js->expectCallCount('link', 2); $this->Paginator->Js->expectCallCount('link', 2);
$result = $this->Paginator->numbers(array( $result = $this->Paginator->numbers(array(
'modulus'=> '2', '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() * test that mock classes injected into paginatorHelper are called when using link()
* *