summaryrefslogtreecommitdiffstats
path: root/install/ui/test
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/test')
-rw-r--r--install/ui/test/association_tests.js36
-rw-r--r--install/ui/test/details_tests.js9
-rw-r--r--install/ui/test/ipa_tests.js18
3 files changed, 38 insertions, 25 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
diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js
index c911d1b61..c6c33bd17 100644
--- a/install/ui/test/details_tests.js
+++ b/install/ui/test/details_tests.js
@@ -25,10 +25,11 @@ define([
'freeipa/details',
'freeipa/facet',
'freeipa/reg',
+ 'freeipa/rpc',
'freeipa/entity',
'freeipa/field',
'freeipa/widget'],
- function(md, IPA, $, mod_details, mod_facet, reg) {
+ function(md, IPA, $, mod_details, mod_facet, reg, rpc) {
return function() {
var details_container;
@@ -127,15 +128,15 @@ test("Testing details lifecycle: create, load.", function(){
data.result = {};
data.result.result = {};
- IPA.command({
+ rpc.command({
entity: 'user',
method: 'show',
args: ['kfrog'],
on_success: function(data, text_status, xhr) {
- ok(true, "IPA.command() succeeded.");
+ ok(true, "rpc.command() succeeded.");
},
on_error: function(xhr, text_status, error_thrown) {
- ok(false, "IPA.command() failed: "+error_thrown);
+ ok(false, "rpc.command() failed: "+error_thrown);
}
}).execute();
diff --git a/install/ui/test/ipa_tests.js b/install/ui/test/ipa_tests.js
index 8ac782ef8..52110c481 100644
--- a/install/ui/test/ipa_tests.js
+++ b/install/ui/test/ipa_tests.js
@@ -18,8 +18,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-define(['freeipa/ipa', 'freeipa/jquery', 'freeipa/dialog', 'freeipa/widget',
- 'freeipa/details'], function(IPA, $) {
+define([
+ 'freeipa/ipa',
+ 'freeipa/jquery',
+ 'freeipa/rpc',
+ 'freeipa/dialog',
+ 'freeipa/widget',
+ 'freeipa/details'],
+ function(IPA, $, rpc) {
return function() {
module('ipa');
@@ -88,7 +94,7 @@ test("Testing IPA.get_member_attribute().", function() {
"IPA.get_member_attribute(null, \"group\")");
});
-test("Testing successful IPA.command().", function() {
+test("Testing successful rpc.command().", function() {
var method = 'method';
var args = ['arg1', 'arg2', 'arg3'];
@@ -138,7 +144,7 @@ test("Testing successful IPA.command().", function() {
request.success(xhr, text_status, error_thrown);
};
- IPA.command({
+ rpc.command({
entity: object,
method: method,
args: args,
@@ -164,7 +170,7 @@ test("Testing successful IPA.command().", function() {
$.ajax = orig;
});
-test("Testing unsuccessful IPA.command().", function() {
+test("Testing unsuccessful rpc.command().", function() {
var method = 'method';
var args = ['arg1', 'arg2', 'arg3'];
@@ -209,7 +215,7 @@ test("Testing unsuccessful IPA.command().", function() {
request.error(xhr, text_status, error_thrown);
};
- IPA.command({
+ rpc.command({
entity: object,
method: method,
args: args,