Skip to content

Commit

Permalink
More tests for ajax link delegation.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 24, 2010
1 parent bf566e1 commit 9e08196
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cake/tests/cases/libs/view/helpers/paginator.test.php
Expand Up @@ -1830,7 +1830,7 @@ function testNextLinkUsingDotNotation() {
*
* @return void
*/
function testAjaxLinkGeneration() {
function testAjaxLinkGenerationNumbers() {
$this->Paginator->Js->expectCallCount('link', 2);
$result = $this->Paginator->numbers(array(
'modulus'=> '2',
Expand All @@ -1839,6 +1839,18 @@ function testAjaxLinkGeneration() {
));
}

/**
* 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()
*
Expand Down

0 comments on commit 9e08196

Please sign in to comment.