diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-04 19:48:31 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-04 19:48:31 +0000 |
commit | 048969a77c32190e9590115b67a525d61f4752c6 (patch) | |
tree | 97a3e3d8d91db570a82bcb5a4815a6e45ad0170b /js/tests/ElggAjaxTest.js | |
parent | 0ce5ae4b1dcbc4567bb1bd27228eface92ab2bde (diff) | |
download | elgg-048969a77c32190e9590115b67a525d61f4752c6.tar.gz elgg-048969a77c32190e9590115b67a525d61f4752c6.tar.bz2 |
Refs #2771: Removing CRLFs from javascript files.
git-svn-id: http://code.elgg.org/elgg/trunk@7826 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js/tests/ElggAjaxTest.js')
-rw-r--r-- | js/tests/ElggAjaxTest.js | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/js/tests/ElggAjaxTest.js b/js/tests/ElggAjaxTest.js index 1fa5daca5..a683415fc 100644 --- a/js/tests/ElggAjaxTest.js +++ b/js/tests/ElggAjaxTest.js @@ -1,59 +1,59 @@ -/**
- * Makes sure that each of the helper ajax functions ends up calling $.ajax
- * with the right options.
- */
-ElggAjaxTest = TestCase("ElggAjaxTest");
-
-ElggAjaxTest.prototype.setUp = function() {
-
- this.wwwroot = elgg.config.wwwroot;
- this.ajax = $.ajax;
-
- elgg.config.wwwroot = 'http://www.elgg.org/';
-
- $.ajax = function(options) {
- return options;
- };
-};
-
-ElggAjaxTest.prototype.tearDown = function() {
- $.ajax = this.ajax;
- elgg.config.wwwroot = this.wwwroot;
-};
-
-ElggAjaxTest.prototype.testElggAjax = function() {
- assertEquals(elgg.config.wwwroot, elgg.ajax().url);
-};
-
-ElggAjaxTest.prototype.testElggGet = function() {
- assertEquals('get', elgg.get().type);
-};
-
-ElggAjaxTest.prototype.testElggGetJSON = function() {
- assertEquals('json', elgg.getJSON().dataType);
-};
-
-ElggAjaxTest.prototype.testElggPost = function() {
- assertEquals('post', elgg.post().type);
-};
-
-ElggAjaxTest.prototype.testElggAction = function() {
- assertException(function() { elgg.action(); });
- assertException(function() { elgg.action({}); });
-
- var result = elgg.action('action');
- assertEquals('post', result.type);
- assertEquals('json', result.dataType);
- assertEquals(elgg.config.wwwroot + 'action/action', result.url);
- assertEquals(elgg.security.token.__elgg_ts, result.data.__elgg_ts);
-};
-
-ElggAjaxTest.prototype.testElggAPI = function() {
- assertException(function() { elgg.api(); });
- assertException(function() { elgg.api({}); });
-
- var result = elgg.api('method');
- assertEquals('json', result.dataType);
- assertEquals('method', result.data.method);
- assertEquals(elgg.config.wwwroot + 'services/api/rest/json/', result.url);
-};
+/** + * Makes sure that each of the helper ajax functions ends up calling $.ajax + * with the right options. + */ +ElggAjaxTest = TestCase("ElggAjaxTest"); + +ElggAjaxTest.prototype.setUp = function() { + + this.wwwroot = elgg.config.wwwroot; + this.ajax = $.ajax; + + elgg.config.wwwroot = 'http://www.elgg.org/'; + + $.ajax = function(options) { + return options; + }; +}; + +ElggAjaxTest.prototype.tearDown = function() { + $.ajax = this.ajax; + elgg.config.wwwroot = this.wwwroot; +}; + +ElggAjaxTest.prototype.testElggAjax = function() { + assertEquals(elgg.config.wwwroot, elgg.ajax().url); +}; + +ElggAjaxTest.prototype.testElggGet = function() { + assertEquals('get', elgg.get().type); +}; + +ElggAjaxTest.prototype.testElggGetJSON = function() { + assertEquals('json', elgg.getJSON().dataType); +}; + +ElggAjaxTest.prototype.testElggPost = function() { + assertEquals('post', elgg.post().type); +}; + +ElggAjaxTest.prototype.testElggAction = function() { + assertException(function() { elgg.action(); }); + assertException(function() { elgg.action({}); }); + + var result = elgg.action('action'); + assertEquals('post', result.type); + assertEquals('json', result.dataType); + assertEquals(elgg.config.wwwroot + 'action/action', result.url); + assertEquals(elgg.security.token.__elgg_ts, result.data.__elgg_ts); +}; + +ElggAjaxTest.prototype.testElggAPI = function() { + assertException(function() { elgg.api(); }); + assertException(function() { elgg.api({}); }); + + var result = elgg.api('method'); + assertEquals('json', result.dataType); + assertEquals('method', result.data.method); + assertEquals(elgg.config.wwwroot + 'services/api/rest/json/', result.url); +}; |