Skip to content
Permalink
Browse files

Fixing typo in prototype engine helper. Fixes #172

  • Loading branch information...
markstory committed Oct 15, 2009
1 parent 38f65bd commit 906eb82e9b1963677e82168b4cfe652cd54a41a2
@@ -37,7 +37,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
**/
var $_optionMap = array(
'request' => array(
'async' => 'asyncrhronous',
'async' => 'asynchronous',
'data' => 'parameters',
'before' => 'onCreate',
'success' => 'onSuccess',
@@ -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);
}
/**

0 comments on commit 906eb82

Please sign in to comment.
You can’t perform that action at this time.