From f3785e4d2368e3f67c844d8523b429e67cd3abfc Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Sat, 24 Aug 2013 16:10:32 +0200 Subject: [PATCH 001/114] jquery-rails does not include jquery-ui anymore --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 802c44d5..bc488b72 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ a. For Rails 3.1, add these lines to the top of your app/assets/javascripts/appl //= require jquery_ujs ``` -b. For Rails 3.0, run this command (add `--ui` if you want jQuery UI): +b. For Rails 3.0, run this command: *Be sure to get rid of the rails.js file if it exists, and instead use the new jquery_ujs.js file that gets copied to the public directory. From cb7d4df9fe433477a8bf4797403518f7d3e6db66 Mon Sep 17 00:00:00 2001 From: Jason Moon Date: Tue, 27 Aug 2013 22:09:56 -0500 Subject: [PATCH 002/114] Wait to do the form DOM scans until absolutely necessary --- src/rails.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rails.js b/src/rails.js index 84f9e6bc..2b1e9b4b 100644 --- a/src/rails.js +++ b/src/rails.js @@ -331,17 +331,21 @@ $document.delegate(rails.formSubmitSelector, 'submit.rails', function(e) { var form = $(this), remote = form.data('remote') !== undefined, - blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector), - nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); + blankRequiredInputs, + nonBlankFileInputs; if (!rails.allowAction(form)) return rails.stopEverything(e); // skip other logic when required values are missing or file upload is present - if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { - return rails.stopEverything(e); + if (form.attr('novalidate') == undefined) { + blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector); + if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { + return rails.stopEverything(e); + } } if (remote) { + nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); if (nonBlankFileInputs) { // slight timeout so that the submit button gets properly serialized // (make it easy for event handler to serialize form without disabled values) From 031eb86a23a1065a6ae19e09f95497b0f6a44667 Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Fri, 20 Sep 2013 15:32:07 -0700 Subject: [PATCH 003/114] Adding bower.json --- bower.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..a65510a8 --- /dev/null +++ b/bower.json @@ -0,0 +1,16 @@ +{ + name: 'jquery-ujs', + version: '3.0.4', + homepage: 'https://github.com/rails/jquery-ujs', + authors: [], + description: 'Ruby on Rails unobtrusive scripting adapter for jQuery', + main: 'src/rails.js', + license: 'MIT', + ignore: [ + '**/.*', + 'Gemfile.*', + 'Rakefile', + 'bower_components', + 'test', + ] +} From ec574b3f76530493af3cf087ce786e3fc3f6b9bf Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Fri, 20 Sep 2013 15:34:29 -0700 Subject: [PATCH 004/114] Valid JSON is nice --- bower.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bower.json b/bower.json index a65510a8..bf16ce86 100644 --- a/bower.json +++ b/bower.json @@ -1,16 +1,16 @@ { - name: 'jquery-ujs', - version: '3.0.4', - homepage: 'https://github.com/rails/jquery-ujs', - authors: [], - description: 'Ruby on Rails unobtrusive scripting adapter for jQuery', - main: 'src/rails.js', - license: 'MIT', - ignore: [ - '**/.*', - 'Gemfile.*', - 'Rakefile', - 'bower_components', - 'test', + "name": "jquery-ujs", + "version": "3.0.4", + "homepage": "https://github.com/rails/jquery-ujs", + "authors": [], + "description": "Ruby on Rails unobtrusive scripting adapter for jQuery", + "main": "src/rails.js", + "license": "MIT", + "ignore": [ + "**/.*", + "Gemfile.*", + "Rakefile", + "bower_components", + "test" ] } From 04cb0623ba77e59974e9555abdf8b56aa5fb858f Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Fri, 20 Sep 2013 15:35:54 -0700 Subject: [PATCH 005/114] Omitting Gemfile as well as Gemfile.lock --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index bf16ce86..991d2684 100644 --- a/bower.json +++ b/bower.json @@ -8,7 +8,7 @@ "license": "MIT", "ignore": [ "**/.*", - "Gemfile.*", + "Gemfile*", "Rakefile", "bower_components", "test" From 97588668ec13526ea5832763a20682876c661660 Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Fri, 20 Sep 2013 15:37:54 -0700 Subject: [PATCH 006/114] Adding jquery as a dependency --- bower.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bower.json b/bower.json index 991d2684..c96d9bd3 100644 --- a/bower.json +++ b/bower.json @@ -6,6 +6,9 @@ "description": "Ruby on Rails unobtrusive scripting adapter for jQuery", "main": "src/rails.js", "license": "MIT", + "dependencies": { + "jquery": "~1.10.2" + }, "ignore": [ "**/.*", "Gemfile*", From 9a55173e6727d874ed2880d005b3e1949b3f251f Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Thu, 31 Oct 2013 17:35:26 -0200 Subject: [PATCH 007/114] Update rubygems.org URL and remove json gem dependency. --- Gemfile | 3 +-- Gemfile.lock | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index e32e523b..8d6aa8d1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' gem 'sinatra', '~> 1.0' gem 'shotgun', :group => :reloadable gem 'thin', :group => :reloadable -gem 'json' diff --git a/Gemfile.lock b/Gemfile.lock index 42460e58..f4f2623d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,8 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: daemons (1.1.0) eventmachine (0.12.10) - json (1.4.6) rack (1.2.1) shotgun (0.8) rack (>= 1.0) @@ -20,7 +19,6 @@ PLATFORMS ruby DEPENDENCIES - json shotgun sinatra (~> 1.0) thin From f6fa5a5dd8985f636d8419f8eeb0a4fdfef91ecf Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Thu, 31 Oct 2013 18:10:08 -0200 Subject: [PATCH 008/114] Do not disable elements on ctrl/cmd clicks. Closes #310. --- src/rails.js | 6 +++--- test/public/test/data-disable.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/rails.js b/src/rails.js index 84f9e6bc..0786ab12 100644 --- a/src/rails.js +++ b/src/rails.js @@ -289,13 +289,13 @@ }); $document.delegate(rails.linkClickSelector, 'click.rails', function(e) { - var link = $(this), method = link.data('method'), data = link.data('params'); + var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey; if (!rails.allowAction(link)) return rails.stopEverything(e); - if (link.is(rails.linkDisableSelector)) rails.disableElement(link); + if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link); if (link.data('remote') !== undefined) { - if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; } + if (metaClick && (!method || method === 'GET') && !data) { return true; } var handleRemote = rails.handleRemote(link); // response from rails.handleRemote() will either be false or a deferred object promise. diff --git a/test/public/test/data-disable.js b/test/public/test/data-disable.js index 6c973dfd..0f58214a 100644 --- a/test/public/test/data-disable.js +++ b/test/public/test/data-disable.js @@ -245,3 +245,21 @@ asyncTest('form[data-remote] input|button|textarea[data-disable-with] does not d start(); }); + +asyncTest('ctrl-clicking on a link does not disables the link', 0, function() { + var link = $('a[data-disable-with]'), e; + e = $.Event('click'); + e.metaKey = true; + + checkEnabledState(link, 'Click me'); + + link.trigger(e); + checkEnabledState(link, 'Click me'); + + e = $.Event('click'); + e.ctrlKey = true; + + link.trigger(e); + checkEnabledState(link, 'Click me'); + start(); +}); From 2e6a440cbff8da7b2f4f2e5b82723c5ca6516093 Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Thu, 31 Oct 2013 22:21:05 -0700 Subject: [PATCH 009/114] Swapping to starred minor and patch versions --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index c96d9bd3..1f70fa63 100644 --- a/bower.json +++ b/bower.json @@ -7,7 +7,7 @@ "main": "src/rails.js", "license": "MIT", "dependencies": { - "jquery": "~1.10.2" + "jquery": "1.*.*" }, "ignore": [ "**/.*", From 6b3d3fbea6f9aaf7761c314b866922fa7fe80b30 Mon Sep 17 00:00:00 2001 From: Paul Sweeney Date: Thu, 31 Oct 2013 22:23:40 -0700 Subject: [PATCH 010/114] jQuery greater than 1.7, less than 2.0 --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 1f70fa63..a5f1c5aa 100644 --- a/bower.json +++ b/bower.json @@ -7,7 +7,7 @@ "main": "src/rails.js", "license": "MIT", "dependencies": { - "jquery": "1.*.*" + "jquery": ">1.7.* <2.0.0" }, "ignore": [ "**/.*", From 20ca9086030966d75efa8593a7af8ba666aacb6a Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Fri, 1 Nov 2013 10:51:30 -0200 Subject: [PATCH 011/114] Change snake_case usage to camelCase The majority of the source code on this repo follows this convention so the rest should look like the same. --- src/rails.js | 18 +++++------ test/public/test/call-remote-callbacks.js | 6 ++-- test/public/test/call-remote.js | 38 +++++++++++------------ test/public/test/data-confirm.js | 22 ++++++------- test/public/test/data-remote.js | 24 +++++++------- test/public/test/settings.js | 24 +++++++------- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/rails.js b/src/rails.js index 0786ab12..4659b03c 100644 --- a/src/rails.js +++ b/src/rails.js @@ -161,18 +161,18 @@ var href = rails.href(link), method = link.data('method'), target = link.attr('target'), - csrf_token = $('meta[name=csrf-token]').attr('content'), - csrf_param = $('meta[name=csrf-param]').attr('content'), + csrfToken = $('meta[name=csrf-token]').attr('content'), + csrfParam = $('meta[name=csrf-param]').attr('content'), form = $('
'), - metadata_input = ''; + metadataInput = ''; - if (csrf_param !== undefined && csrf_token !== undefined) { - metadata_input += ''; + if (csrfParam !== undefined && csrfToken !== undefined) { + metadataInput += ''; } if (target) { form.attr('target', target); } - form.hide().append(metadata_input).appendTo('body'); + form.hide().append(metadataInput).appendTo('body'); form.submit(); }, @@ -385,9 +385,9 @@ $(function(){ // making sure that all forms have actual up-to-date token(cached forms contain old one) - var csrf_token = $('meta[name=csrf-token]').attr('content'); - var csrf_param = $('meta[name=csrf-param]').attr('content'); - $('form input[name="' + csrf_param + '"]').val(csrf_token); + var csrfToken = $('meta[name=csrf-token]').attr('content'); + var csrfParam = $('meta[name=csrf-param]').attr('content'); + $('form input[name="' + csrfParam + '"]').val(csrfToken); }); } diff --git a/test/public/test/call-remote-callbacks.js b/test/public/test/call-remote-callbacks.js index 60bff422..b4c4c7c7 100644 --- a/test/public/test/call-remote-callbacks.js +++ b/test/public/test/call-remote-callbacks.js @@ -53,7 +53,7 @@ asyncTest('modifying data("type") with "ajax:before" requests new dataType in re $('form[data-remote]').data('type','html') .bind('ajax:before', function() { var form = $(this); - form.data('type','xml') + form.data('type','xml'); }); submit(function(form) { @@ -67,7 +67,7 @@ asyncTest('setting data("cross-domain",true) with "ajax:before" uses new setting $('form[data-remote]').data('cross-domain',false) .bind('ajax:before', function() { var form = $(this); - form.data('cross-domain',true) + form.data('cross-domain',true); }); submit(function(form) { @@ -94,7 +94,7 @@ asyncTest('setting data("with-credentials",true) with "ajax:before" uses new set asyncTest('stopping the "ajax:beforeSend" event aborts the request', 1, function() { submit(function(form) { form.bind('ajax:beforeSend', function() { - ok(true, 'aborting request in ajax:beforeSend') + ok(true, 'aborting request in ajax:beforeSend'); return false; }); form.unbind('ajax:complete').bind('ajax:complete', function() { diff --git a/test/public/test/call-remote.js b/test/public/test/call-remote.js index ef998a8b..d78ce565 100644 --- a/test/public/test/call-remote.js +++ b/test/public/test/call-remote.js @@ -1,6 +1,6 @@ (function(){ -function build_form(attrs) { +function buildForm(attrs) { attrs = $.extend({ action: '/echo', 'data-remote': 'true' }, attrs); $('#qunit-fixture').append($('
', attrs)) @@ -17,47 +17,47 @@ function submit(fn) { } asyncTest('form method is read from "method" and not from "data-method"', 1, function() { - build_form({ method: 'post', 'data-method': 'get' }); + buildForm({ method: 'post', 'data-method': 'get' }); submit(function(e, data, status, xhr) { - App.assert_post_request(data); + App.assertPostRequest(data); }); }); asyncTest('form method is not read from "data-method" attribute in case of missing "method"', 1, function() { - build_form({ 'data-method': 'put' }); + buildForm({ 'data-method': 'put' }); submit(function(e, data, status, xhr) { - App.assert_get_request(data); + App.assertGetRequest(data); }); }); asyncTest('form default method is GET', 1, function() { - build_form(); + buildForm(); submit(function(e, data, status, xhr) { - App.assert_get_request(data); + App.assertGetRequest(data); }); }); asyncTest('form url is picked up from "action"', 1, function() { - build_form({ method: 'post' }); + buildForm({ method: 'post' }); submit(function(e, data, status, xhr) { - App.assert_request_path(data, '/echo'); + App.assertRequestPath(data, '/echo'); }); }); asyncTest('form url is read from "action" not "href"', 1, function() { - build_form({ method: 'post', href: '/echo2' }); + buildForm({ method: 'post', href: '/echo2' }); submit(function(e, data, status, xhr) { - App.assert_request_path(data, '/echo'); + App.assertRequestPath(data, '/echo'); }); }); asyncTest('prefer JS, but accept any format', 1, function() { - build_form({ method: 'post' }); + buildForm({ method: 'post' }); submit(function(e, data, status, xhr) { var accept = data.HTTP_ACCEPT; @@ -66,7 +66,7 @@ asyncTest('prefer JS, but accept any format', 1, function() { }); asyncTest('accept application/json if "data-type" is json', 1, function() { - build_form({ method: 'post', 'data-type': 'json' }); + buildForm({ method: 'post', 'data-type': 'json' }); submit(function(e, data, status, xhr) { equal(data.HTTP_ACCEPT, 'application/json, text/javascript, */*; q=0.01'); @@ -75,7 +75,7 @@ asyncTest('accept application/json if "data-type" is json', 1, function() { asyncTest('allow empty "data-remote" attribute', 1, function() { var form = $('#qunit-fixture').append($('')).find('form'); - + submit(function() { ok(true, 'form with empty "data-remote" attribute is also allowed'); }); @@ -84,7 +84,7 @@ asyncTest('allow empty "data-remote" attribute', 1, function() { asyncTest('allow empty form "action"', 1, function() { var currentLocation, ajaxLocation; - build_form({ action: '' }); + buildForm({ action: '' }); $('#qunit-fixture').find('form') .bind('ajax:beforeSend', function(e, xhr, settings) { @@ -114,7 +114,7 @@ asyncTest('allow empty form "action"', 1, function() { }); asyncTest('sends CSRF token in custom header', 1, function() { - build_form({ method: 'post' }); + buildForm({ method: 'post' }); $('#qunit-fixture').append(''); submit(function(e, data, status, xhr) { @@ -123,7 +123,7 @@ asyncTest('sends CSRF token in custom header', 1, function() { }); asyncTest('does not send CSRF token in custom header if crossDomain', 1, function() { - build_form({ 'data-cross-domain': 'true' }); + buildForm({ 'data-cross-domain': 'true' }); $('#qunit-fixture').append(''); // Manually set request header to be XHR, since setting crossDomain: true in .ajax() @@ -141,7 +141,7 @@ asyncTest('does not send CSRF token in custom header if crossDomain', 1, functio asyncTest('intelligently guesses crossDomain behavior when target URL is a different domain', 1, function(e, xhr) { // Don't set data-cross-domain here, just set action to be a different domain than localhost - build_form({ action: 'http://www.alfajango.com' }); + buildForm({ action: 'http://www.alfajango.com' }); $('#qunit-fixture').append(''); $('#qunit-fixture').find('form') @@ -158,7 +158,7 @@ asyncTest('intelligently guesses crossDomain behavior when target URL is a diffe }); asyncTest('does not set crossDomain if explicitly set to false on element', 1, function() { - build_form({ action: 'http://www.alfajango.com', 'data-cross-domain': false }); + buildForm({ action: 'http://www.alfajango.com', 'data-cross-domain': false }); $('#qunit-fixture').append(''); $('#qunit-fixture').find('form') diff --git a/test/public/test/data-confirm.js b/test/public/test/data-confirm.js index 68784b84..50735e17 100644 --- a/test/public/test/data-confirm.js +++ b/test/public/test/data-confirm.js @@ -21,13 +21,13 @@ asyncTest('clicking on a link with data-confirm attribute. Confirm yes.', 6, fun $('a[data-confirm]') .bind('confirm:complete', function(e, data) { - App.assert_callback_invoked('confirm:complete'); + App.assertCallbackInvoked('confirm:complete'); ok(data == true, 'confirm:complete passes in confirm answer (true)'); }) - .bind('ajax:success', function(e, data, status, xhr) { - App.assert_callback_invoked('ajax:success'); - App.assert_request_path(data, '/echo'); - App.assert_get_request(data); + .bind('ajax:success', function(e, data, status, xhr) { + App.assertCallbackInvoked('ajax:success'); + App.assertRequestPath(data, '/echo'); + App.assertGetRequest(data); equal(message, 'Are you absolutely sure?'); start(); @@ -42,11 +42,11 @@ asyncTest('clicking on a link with data-confirm attribute. Confirm No.', 3, func $('a[data-confirm]') .bind('confirm:complete', function(e, data) { - App.assert_callback_invoked('confirm:complete'); + App.assertCallbackInvoked('confirm:complete'); ok(data == false, 'confirm:complete passes in confirm answer (false)'); }) .bind('ajax:beforeSend', function(e, data, status, xhr) { - App.assert_callback_not_invoked('ajax:beforeSend'); + App.assertCallbackNotInvoked('ajax:beforeSend'); }) .trigger('click'); @@ -65,11 +65,11 @@ asyncTest('binding to confirm event and returning false', 1, function() { $('a[data-confirm]') .bind('confirm', function() { - App.assert_callback_invoked('confirm'); + App.assertCallbackInvoked('confirm'); return false; }) .bind('confirm:complete', function() { - App.assert_callback_not_invoked('confirm:complete') + App.assertCallbackNotInvoked('confirm:complete'); }) .trigger('click'); @@ -87,11 +87,11 @@ asyncTest('binding to confirm:complete event and returning false', 2, function() $('a[data-confirm]') .bind('confirm:complete', function() { - App.assert_callback_invoked('confirm:complete'); + App.assertCallbackInvoked('confirm:complete'); return false; }) .bind('ajax:beforeSend', function() { - App.assert_callback_not_invoked('ajax:beforeSend'); + App.assertCallbackNotInvoked('ajax:beforeSend'); }) .trigger('click'); diff --git a/test/public/test/data-remote.js b/test/public/test/data-remote.js index 3f5c551c..f8c6b2a8 100644 --- a/test/public/test/data-remote.js +++ b/test/public/test/data-remote.js @@ -74,11 +74,11 @@ asyncTest('ctrl-clicking on a link still fires ajax for non-GET links and for li asyncTest('clicking on a link with data-remote attribute', 5, function() { $('a[data-remote]') .bind('ajax:success', function(e, data, status, xhr) { - App.assert_callback_invoked('ajax:success'); - App.assert_request_path(data, '/echo'); + App.assertCallbackInvoked('ajax:success'); + App.assertRequestPath(data, '/echo'); equal(data.params.data1, 'value1', 'ajax arguments should have key data1 with right value'); equal(data.params.data2, 'value2', 'ajax arguments should have key data2 with right value'); - App.assert_get_request(data); + App.assertGetRequest(data); }) .bind('ajax:complete', function() { start() }) .trigger('click'); @@ -87,11 +87,11 @@ asyncTest('clicking on a link with data-remote attribute', 5, function() { asyncTest('clicking on a button with data-remote attribute', 5, function() { $('button[data-remote]') .bind('ajax:success', function(e, data, status, xhr) { - App.assert_callback_invoked('ajax:success'); - App.assert_request_path(data, '/echo'); + App.assertCallbackInvoked('ajax:success'); + App.assertRequestPath(data, '/echo'); equal(data.params.data1, 'value1', 'ajax arguments should have key data1 with right value'); equal(data.params.data2, 'value2', 'ajax arguments should have key data2 with right value'); - App.assert_get_request(data); + App.assertGetRequest(data); }) .bind('ajax:complete', function() { start() }) .trigger('click'); @@ -112,11 +112,11 @@ asyncTest('changing a select option with data-remote attribute', 5, function() { $('select[data-remote]') .bind('ajax:success', function(e, data, status, xhr) { - App.assert_callback_invoked('ajax:success'); - App.assert_request_path(data, '/echo'); + App.assertCallbackInvoked('ajax:success'); + App.assertRequestPath(data, '/echo'); equal(data.params.user_data, 'optionValue2', 'ajax arguments should have key term with right value'); equal(data.params.data1, 'value1', 'ajax arguments should have key data1 with right value'); - App.assert_get_request(data); + App.assertGetRequest(data); }) .bind('ajax:complete', function() { start() }) .val('optionValue2') @@ -126,10 +126,10 @@ asyncTest('changing a select option with data-remote attribute', 5, function() { asyncTest('submitting form with data-remote attribute', 4, function() { $('form[data-remote]') .bind('ajax:success', function(e, data, status, xhr) { - App.assert_callback_invoked('ajax:success'); - App.assert_request_path(data, '/echo'); + App.assertCallbackInvoked('ajax:success'); + App.assertRequestPath(data, '/echo'); equal(data.params.user_name, 'john', 'ajax arguments should have key user_name with right value'); - App.assert_post_request(data); + App.assertPostRequest(data); }) .bind('ajax:complete', function() { start() }) .trigger('submit'); diff --git a/test/public/test/settings.js b/test/public/test/settings.js index e23bf7ed..1eddc251 100644 --- a/test/public/test/settings.js +++ b/test/public/test/settings.js @@ -1,23 +1,23 @@ var App = App || {}; -App.assert_callback_invoked = function(callback_name) { - ok(true, callback_name + ' callback should have been invoked'); +App.assertCallbackInvoked = function(callbackName) { + ok(true, callbackName + ' callback should have been invoked'); }; -App.assert_callback_not_invoked = function(callback_name) { - ok(false, callback_name + ' callback should not have been invoked'); +App.assertCallbackNotInvoked = function(callbackName) { + ok(false, callbackName + ' callback should not have been invoked'); }; -App.assert_get_request = function(request_env){ - equal(request_env['REQUEST_METHOD'], 'GET', 'request type should be GET'); +App.assertGetRequest = function(requestEnv){ + equal(requestEnv['REQUEST_METHOD'], 'GET', 'request type should be GET'); }; -App.assert_post_request = function(request_env){ - equal(request_env['REQUEST_METHOD'], 'POST', 'request type should be POST'); +App.assertPostRequest = function(requestEnv){ + equal(requestEnv['REQUEST_METHOD'], 'POST', 'request type should be POST'); }; -App.assert_request_path = function(request_env, path) { - equal(request_env['PATH_INFO'], path, 'request should be sent to right url'); +App.assertRequestPath = function(requestEnv, path) { + equal(requestEnv['PATH_INFO'], path, 'request should be sent to right url'); }; // hijacks normal form submit; lets it submit to an iframe to prevent @@ -27,10 +27,10 @@ $(document).bind('submit', function(e) { var form = $(e.target), action = form.attr('action'), name = 'form-frame' + jQuery.guid++, iframe = $('