diff options
author | Adam Young <ayoung@redhat.com> | 2011-01-12 19:51:22 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-01-14 04:03:47 -0500 |
commit | 680148ed036bcef5ecfc0ca1938b9768d8a233ca (patch) | |
tree | 633e36ec231f41fcf03ff42a922829beef8c551c /install/static/test/association_tests.js | |
parent | 00b3984e5a754b40bd10515ce9629583c78b6c8e (diff) | |
download | freeipa.git-680148ed036bcef5ecfc0ca1938b9768d8a233ca.tar.gz freeipa.git-680148ed036bcef5ecfc0ca1938b9768d8a233ca.tar.xz freeipa.git-680148ed036bcef5ecfc0ca1938b9768d8a233ca.zip |
scoping functions
converting function of the form ipa_<name> to IPA.<name> to remove them from the global namespace.
https://fedorahosted.org/freeipa/ticket/212
Diffstat (limited to 'install/static/test/association_tests.js')
-rw-r--r-- | install/static/test/association_tests.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/install/static/test/association_tests.js b/install/static/test/association_tests.js index 4ce1354d..a65678a7 100644 --- a/install/static/test/association_tests.js +++ b/install/static/test/association_tests.js @@ -18,11 +18,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +module('associate'); + + test("Testing serial_associator().", function() { expect(10); - var orig_ipa_cmd = ipa_cmd; + var orig_ipa_cmd = IPA.cmd; var counter = 0; @@ -35,22 +38,22 @@ test("Testing serial_associator().", function() { params.values = ['user1', 'user2', 'user3']; - ipa_cmd = function(name, args, options, win_callback, fail_callback, objname) { + IPA.cmd = function(name, args, options, win_callback, fail_callback, objname) { counter++; equals( name, params.method, - "Checking ipa_cmd() parameter: method" + "Checking IPA.cmd() parameter: method" ); equals( objname, params.other_entity, - "Checking ipa_cmd() parameter: object name" + "Checking IPA.cmd() parameter: object name" ); equals( args[0], "user"+counter, - "Checking ipa_cmd() parameter: primary key" + "Checking IPA.cmd() parameter: primary key" ); var response = {}; @@ -65,14 +68,14 @@ test("Testing serial_associator().", function() { var associator = serial_associator(params); associator.execute(); - ipa_cmd = orig_ipa_cmd; + IPA.cmd = orig_ipa_cmd; }); test("Testing bulk_associator().", function() { expect(5); - var orig_ipa_cmd = ipa_cmd; + var orig_ipa_cmd = IPA.cmd; var counter = 0; @@ -85,27 +88,27 @@ test("Testing bulk_associator().", function() { params.values = ['user1', 'user2', 'user3']; - ipa_cmd = function(name, args, options, win_callback, fail_callback, objname) { + IPA.cmd = function(name, args, options, win_callback, fail_callback, objname) { counter++; equals( name, params.method, - "Checking ipa_cmd() parameter: method" + "Checking IPA.cmd() parameter: method" ); equals( objname, params.entity_name, - "Checking ipa_cmd() parameter: object name" + "Checking IPA.cmd() parameter: object name" ); equals( args[0], params.pkey, - "Checking ipa_cmd() parameter: primary key" + "Checking IPA.cmd() parameter: primary key" ); equals( options[params.other_entity], "user1,user2,user3", - "Checking ipa_cmd() parameter: options[\""+params.other_entity+"\"]" + "Checking IPA.cmd() parameter: options[\""+params.other_entity+"\"]" ); var response = {}; @@ -120,5 +123,5 @@ test("Testing bulk_associator().", function() { var associator = bulk_associator(params); associator.execute(); - ipa_cmd = orig_ipa_cmd; + IPA.cmd = orig_ipa_cmd; }); |