From d5a0dce27a74ff91f8de91d90104331d6fc01f66 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 25 Apr 2015 17:29:15 +0200 Subject: [PATCH] Clean code. --- src/_h5ai/client/js/inc/boot.js | 2 +- src/_h5ai/client/js/inc/core/server.js | 2 +- src/_h5ai/client/js/inc/main/info.js | 4 ++-- test/tests/unit/boot.js | 4 ++-- test/tests/unit/core/server.js | 4 ++-- test/tests/unit/main/info.js | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/_h5ai/client/js/inc/boot.js b/src/_h5ai/client/js/inc/boot.js index af403a43..f3ddfc18 100644 --- a/src/_h5ai/client/js/inc/boot.js +++ b/src/_h5ai/client/js/inc/boot.js @@ -20,7 +20,7 @@ modulejs.define('boot', ['$'], function ($) { $.ajax({ url: url, data: data, - type: 'POST', + type: 'post', dataType: 'json' }).done(function (config) { diff --git a/src/_h5ai/client/js/inc/core/server.js b/src/_h5ai/client/js/inc/core/server.js index 98e5fa1f..d529b058 100644 --- a/src/_h5ai/client/js/inc/core/server.js +++ b/src/_h5ai/client/js/inc/core/server.js @@ -9,7 +9,7 @@ modulejs.define('core/server', ['_', '$', 'config', 'core/location'], function ( $.ajax({ url: location.getAbsHref(), data: data, - type: 'POST', + type: 'post', dataType: 'json' }) .done(function (json) { diff --git a/src/_h5ai/client/js/inc/main/info.js b/src/_h5ai/client/js/inc/main/info.js index 11e58b2b..b2332dcd 100644 --- a/src/_h5ai/client/js/inc/main/info.js +++ b/src/_h5ai/client/js/inc/main/info.js @@ -110,8 +110,8 @@ modulejs.define('main/info', ['$', 'config'], function ($, config) { $.ajax({ url: 'server/php/index.php', - type: 'POST', - dataType: 'JSON', + type: 'post', + dataType: 'json', data: data }) .always(function () { diff --git a/test/tests/unit/boot.js b/test/tests/unit/boot.js index 78f21d1a..dbf68e48 100644 --- a/test/tests/unit/boot.js +++ b/test/tests/unit/boot.js @@ -112,7 +112,7 @@ describe('module \'' + ID + '\'', function () { assert.isTrue(this.xAjax.calledOnce); assert.strictEqual(this.xAjax.lastCall.args[0].url, 'server/php/index.php'); - assert.strictEqual(this.xAjax.lastCall.args[0].type, 'POST'); + assert.strictEqual(this.xAjax.lastCall.args[0].type, 'post'); assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json'); assert.isTrue(this.xAjaxResult.done.calledOnce); @@ -134,7 +134,7 @@ describe('module \'' + ID + '\'', function () { assert.isTrue(this.xAjax.calledOnce); assert.strictEqual(this.xAjax.lastCall.args[0].url, '.'); - assert.strictEqual(this.xAjax.lastCall.args[0].type, 'POST'); + assert.strictEqual(this.xAjax.lastCall.args[0].type, 'post'); assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json'); assert.isTrue(this.xAjaxResult.done.calledOnce); diff --git a/test/tests/unit/core/server.js b/test/tests/unit/core/server.js index 6b92b5ce..17e7c85c 100644 --- a/test/tests/unit/core/server.js +++ b/test/tests/unit/core/server.js @@ -200,7 +200,7 @@ describe('module \'' + ID + '\'', function () { assert.deepEqual(this.xAjax.lastCall.args, [{ url: this.xAbsHref, data: xData, - type: 'POST', + type: 'post', dataType: 'json' }]); assert.isTrue(this.xAjaxResult.done.calledOnce); @@ -229,7 +229,7 @@ describe('module \'' + ID + '\'', function () { assert.deepEqual(this.xAjax.lastCall.args, [{ url: this.xAbsHref, data: xData, - type: 'POST', + type: 'post', dataType: 'json' }]); assert.isTrue(this.xAjaxResult.done.calledOnce); diff --git a/test/tests/unit/main/info.js b/test/tests/unit/main/info.js index 4e65627b..58b51abd 100644 --- a/test/tests/unit/main/info.js +++ b/test/tests/unit/main/info.js @@ -139,8 +139,8 @@ describe('module \'' + ID + '\'', function () { assert.isTrue(this.xAjax.calledOnce); assert.deepEqual(this.xAjax.lastCall.args, [{ url: 'server/php/index.php', - type: 'POST', - dataType: 'JSON', + type: 'post', + dataType: 'json', data: { action: 'login', pass: pass @@ -194,8 +194,8 @@ describe('module \'' + ID + '\'', function () { assert.isTrue(this.xAjax.calledOnce); assert.deepEqual(this.xAjax.lastCall.args, [{ url: 'server/php/index.php', - type: 'POST', - dataType: 'JSON', + type: 'post', + dataType: 'json', data: { action: 'logout' }