Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing typo in prototype engine helper. Fixes #172

  • Loading branch information...
commit 906eb82e9b1963677e82168b4cfe652cd54a41a2 1 parent 38f65bd
Mark Story markstory authored
2  cake/libs/view/helpers/prototype_engine.php
View
@@ -37,7 +37,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
**/
var $_optionMap = array(
'request' => array(
- 'async' => 'asyncrhronous',
+ 'async' => 'asynchronous',
'data' => 'parameters',
'before' => 'onCreate',
'success' => 'onSuccess',
13 cake/tests/cases/libs/view/helpers/prototype_engine.test.php
View
@@ -227,7 +227,7 @@ function testRequest() {
));
$expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:doSuccess, onFailure:handleError, parameters:$("element").serialize()});';
$this->assertEqual($result, $expected);
-
+
$result = $this->Proto->request('/people/edit/1', array(
'method' => 'post',
'before' => 'doBefore();',
@@ -237,6 +237,17 @@ function testRequest() {
));
$expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:function (transport) {doComplete();}, onCreate:function (transport) {doBefore();}, onFailure:function (response, jsonHeader) {handleError();}, onSuccess:function (response, jsonHeader) {doSuccess();}});';
$this->assertEqual($result, $expected);
+
+ $result = $this->Proto->request('/people/edit/1', array(
+ 'async' => false,
+ 'method' => 'post',
+ 'before' => 'doBefore();',
+ 'success' => 'doSuccess();',
+ 'complete' => 'doComplete();',
+ 'error' => 'handleError();',
+ ));
+ $expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {asynchronous:false, method:"post", onComplete:function (transport) {doComplete();}, onCreate:function (transport) {doBefore();}, onFailure:function (response, jsonHeader) {handleError();}, onSuccess:function (response, jsonHeader) {doSuccess();}});';
+ $this->assertEqual($result, $expected);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.