diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-03-10 17:05:51 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-03-27 14:54:08 +0100 |
commit | 06a7a1b3cb277284448dd8344940395f0b29cd70 (patch) | |
tree | 2204bfebe49d3a2224fd4d5828c4980956ea4a26 /install/ui/test/association_tests.js | |
parent | d5cf0b273ad511d6cb99fbcb900eff528fe172df (diff) | |
download | freeipa-06a7a1b3cb277284448dd8344940395f0b29cd70.tar.gz freeipa-06a7a1b3cb277284448dd8344940395f0b29cd70.tar.xz freeipa-06a7a1b3cb277284448dd8344940395f0b29cd70.zip |
webui: replace IPA.command usage with rpc.command
Replace all IPA.command, IPA.batch_command and IPA.concurrent_command usages
by equivalents from rpc module.
Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
Diffstat (limited to 'install/ui/test/association_tests.js')
-rw-r--r-- | install/ui/test/association_tests.js | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/install/ui/test/association_tests.js b/install/ui/test/association_tests.js index 40daacee8..7580c5fe6 100644 --- a/install/ui/test/association_tests.js +++ b/install/ui/test/association_tests.js @@ -19,8 +19,14 @@ */ -define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/association', 'freeipa/entity'], function(IPA, $) { - return function() { +define([ + 'freeipa/ipa', + 'freeipa/jquery', + 'freeipa/rpc', + 'freeipa/association', + 'freeipa/entity' +], function(IPA, $, rpc) + { return function() { module('association'); @@ -29,7 +35,7 @@ test("Testing serial_associator().", function() { expect(11); - var orig_ipa_batch_command = IPA.batch_command; + var orig_ipa_batch_command = rpc.batch_command; var user = IPA.entity({ name: 'user' }); var group = IPA.entity({ name: 'group' }); @@ -43,13 +49,13 @@ test("Testing serial_associator().", function() { params.values = ['user1', 'user2', 'user3']; - IPA.batch_command = function(spec) { + rpc.batch_command = function(spec) { var that = orig_ipa_batch_command(spec); that.execute = function() { equals(that.commands.length, params.values.length, - 'Checking IPA.batch_command command count'); + 'Checking rpc.batch_command command count'); var i, command; @@ -58,15 +64,15 @@ test("Testing serial_associator().", function() { equals( command.entity, params.other_entity.name, - 'Checking IPA.command() parameter: entity'); + 'Checking rpc.command() parameter: entity'); equals( command.method, params.method, - 'Checking IPA.command() parameter: method'); + 'Checking rpc.command() parameter: method'); equals( command.args[0], 'user'+(i+1), - 'Checking IPA.command() parameter: primary key'); + 'Checking rpc.command() parameter: primary key'); } that.on_success({}); @@ -82,14 +88,14 @@ test("Testing serial_associator().", function() { var associator = IPA.serial_associator(params); associator.execute(); - IPA.batch_command = orig_ipa_batch_command; + rpc.batch_command = orig_ipa_batch_command; }); test("Testing bulk_associator().", function() { expect(4); - var orig_ipa_command = IPA.command; + var orig_ipa_command = rpc.command; var counter = 0; @@ -105,7 +111,7 @@ test("Testing bulk_associator().", function() { params.values = ['user1', 'user2', 'user3']; - IPA.command = function(spec) { + rpc.command = function(spec) { var that = orig_ipa_command(spec); @@ -114,15 +120,15 @@ test("Testing bulk_associator().", function() { equals( that.method, params.method, - 'Checking IPA.command() parameter: method'); + 'Checking rpc.command() parameter: method'); equals( that.args[0], params.pkey, - 'Checking IPA.command() parameter: primary key'); + 'Checking rpc.command() parameter: primary key'); equals( that.options[params.other_entity.name], 'user1,user2,user3', - 'Checking IPA.command() parameter: options[\""+params.other_entity+"\"]'); + 'Checking rpc.command() parameter: options[\""+params.other_entity+"\"]'); that.on_success({}); }; @@ -137,7 +143,7 @@ test("Testing bulk_associator().", function() { var associator = IPA.bulk_associator(params); associator.execute(); - IPA.command = orig_ipa_command; + rpc.command = orig_ipa_command; }); };});
\ No newline at end of file |