Additional Ajax test

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4459 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-06 14:28:04 +00:00
parent 454d9716d2
commit 3500fa5917

View file

@ -51,6 +51,10 @@ class AjaxTest extends UnitTestCase {
$result = $this->ajax->link('Test Link', '/', array('id' => 'link1', 'update' => 'content', 'evalScripts' => false));
$expected = '<a href="/" id="link1" onclick=" return false;">Test Link</a><script type="text/javascript">Event.observe(\'link1\', \'click\', function(event){ new Ajax.Updater(\'content\',\'/\', {asynchronous:true, evalScripts:false, requestHeaders:[\'X-Update\', \'content\']}) }, false);</script>';
$this->assertEqual($result, $expected);
$result = $this->ajax->link('Test Link', '/', array('id' => 'link1', 'update' => 'content'));
$expected = '<a href="/" id="link1" onclick=" return false;">Test Link</a><script type="text/javascript">Event.observe(\'link1\', \'click\', function(event){ new Ajax.Updater(\'content\',\'/\', {asynchronous:true, evalScripts:true, requestHeaders:[\'X-Update\', \'content\']}) }, false);</script>';
$this->assertEqual($result, $expected);
}
function testAsynchronous() {