From e84bd27af2db254fb1ed5ccc58202f0fb5c6f8cc Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 17 Nov 2011 12:09:00 -0600 Subject: Fixed entity definition in test cases. The test cases have been updated to use the new extensible mechanism for defining and registering entities. Ticket #2043 --- install/ui/test/entity_tests.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'install/ui/test/entity_tests.js') diff --git a/install/ui/test/entity_tests.js b/install/ui/test/entity_tests.js index 84a5e28f..f6554938 100644 --- a/install/ui/test/entity_tests.js +++ b/install/ui/test/entity_tests.js @@ -31,14 +31,20 @@ module('entity',{ url: 'data', on_success: function(data, text_status, xhr) { - IPA.entity_factories.user = function(){ - return IPA. - entity_builder(). - entity('user'). - search_facet({ - columns:['uid']}). - build(); - }; + IPA.register('user', function(spec) { + + var that = IPA.entity(spec); + + that.init = function(params) { + that.entity_init(params); + + params.builder.search_facet({ + columns: [ 'uid' ] + }); + }; + + return that; + }); }, on_error: function(xhr, text_status, error_thrown) { ok(false, "ipa_init() failed: "+error_thrown); @@ -60,12 +66,7 @@ test('Testing IPA.entity_set_search_definition().', function() { return true; }; - var entity = IPA. - entity_builder(). - entity('user'). - search_facet({ - columns:['uid']}). - build(); + var entity = IPA.get_entity('user'); var entity_container = $('
', { name: 'user', -- cgit