mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
Fixes for ipa_test.js
Basically add API version into the API request. The API version was not required before. https://pagure.io/freeipa/issue/6974 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
9e0db0759a
commit
4fb52371f2
@ -79,7 +79,7 @@ test("Testing IPA.get_entity_param().", function() {
|
||||
test("Testing IPA.get_member_attribute().", function() {
|
||||
|
||||
equals(
|
||||
IPA.get_member_attribute("user", "group"), "memberof",
|
||||
IPA.get_member_attribute("user", "group"), "memberofindirect",
|
||||
"IPA.get_member_attribute(\"user\", \"group\")");
|
||||
|
||||
equals(
|
||||
@ -119,7 +119,9 @@ test("Testing successful rpc.command().", function() {
|
||||
|
||||
var orig = $.ajax;
|
||||
|
||||
var xhr = {};
|
||||
// Result needs to be there as it is place where message from API call is
|
||||
// stored
|
||||
var xhr = {"result": {}};
|
||||
var text_status = null;
|
||||
var error_thrown = {name:'ERROR', message:'An error has occurred'};
|
||||
|
||||
@ -138,6 +140,9 @@ test("Testing successful rpc.command().", function() {
|
||||
data.method, object+'_'+method,
|
||||
"Checking method");
|
||||
|
||||
// By default all rpc calls contain version of API
|
||||
$.extend(options, {'version': window.ipa_loader.api_version});
|
||||
|
||||
same(
|
||||
data.params, [args, options],
|
||||
"Checking parameters");
|
||||
@ -212,8 +217,14 @@ test("Testing unsuccessful rpc.command().", function() {
|
||||
|
||||
equals(data.method, object+'_'+method, "Checking method");
|
||||
|
||||
// By default all rpc calls contain version of API
|
||||
$.extend(options, { 'version': window.ipa_loader.api_version});
|
||||
|
||||
same(data.params, [args, options], "Checking parameters");
|
||||
|
||||
// remove api version from options object
|
||||
delete options.version;
|
||||
|
||||
request.error(xhr, text_status, error_thrown);
|
||||
};
|
||||
|
||||
@ -313,4 +324,4 @@ test("Testing observer.", function() {
|
||||
obj.event.notify([param1_value, param2_value], obj);
|
||||
});
|
||||
|
||||
};});
|
||||
};});
|
||||
|
Loading…
Reference in New Issue
Block a user