Merge "resources: Strip '$' and 'mw' from file closures"
[lhc/web/wiklou.git] / tests / qunit / suites / resources / mediawiki.api / mediawiki.api.options.test.js
index 854e4b1..549deb0 100644 (file)
@@ -1,4 +1,4 @@
-( function ( mw ) {
+( function () {
        QUnit.module( 'mediawiki.api.options', QUnit.newMwEnvironment( {
                setup: function () {
                        this.server = this.sandbox.useFakeServer();
@@ -30,7 +30,7 @@
 
                // Requests are POST, match requestBody instead of url
                this.server.respond( function ( request ) {
-                       if ( $.inArray( request.requestBody, [
+                       if ( [
                                // simple
                                'action=options&format=json&formatversion=2&change=foo%3Dbar&token=%2B%5C',
                                // two options
@@ -43,7 +43,7 @@
                                'action=options&format=json&formatversion=2&change=foo&token=%2B%5C',
                                // reset an option, not bundleable
                                'action=options&format=json&formatversion=2&optionname=foo%7Cbar%3Dquux&token=%2B%5C'
-                       ] ) !== -1 ) {
+                       ].indexOf( request.requestBody ) !== -1 ) {
                                assert.ok( true, 'Repond to ' + request.requestBody );
                                request.respond( 200, { 'Content-Type': 'application/json' },
                                        '{ "options": "success" }' );
@@ -88,7 +88,7 @@
 
                // Requests are POST, match requestBody instead of url
                this.server.respond( function ( request ) {
-                       if ( $.inArray( request.requestBody, [
+                       if ( [
                                // simple
                                'action=options&format=json&formatversion=2&change=foo%3Dbar&token=%2B%5C',
                                // two options
                                'action=options&format=json&formatversion=2&change=foo&token=%2B%5C',
                                // reset an option, not bundleable
                                'action=options&format=json&formatversion=2&optionname=foo%7Cbar%3Dquux&token=%2B%5C'
-                       ] ) !== -1 ) {
+                       ].indexOf( request.requestBody ) !== -1 ) {
                                assert.ok( true, 'Repond to ' + request.requestBody );
-                               request.respond( 200, { 'Content-Type': 'application/json' },
-                                               '{ "options": "success" }' );
+                               request.respond(
+                                       200,
+                                       { 'Content-Type': 'application/json' },
+                                       '{ "options": "success" }'
+                               );
                        } else {
                                assert.ok( false, 'Unexpected request: ' + request.requestBody );
                        }
                        } )
                );
        } );
-}( mediaWiki ) );
+}() );