From 99b267a9fc4b023e54a9d2c8ec9bd9fe42a32e54 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Tue, 2 Nov 2010 15:24:35 +0000 Subject: Refs #2538: Renamed elgg.extendUrl to elgg.normalize_url git-svn-id: http://code.elgg.org/elgg/trunk@7188 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/js/tests/ElggLibTest.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'engine/js/tests/ElggLibTest.js') diff --git a/engine/js/tests/ElggLibTest.js b/engine/js/tests/ElggLibTest.js index ed4db24e1..035b60325 100644 --- a/engine/js/tests/ElggLibTest.js +++ b/engine/js/tests/ElggLibTest.js @@ -73,12 +73,16 @@ ElggLibTest.prototype.testInherit = function() { }; ElggLibTest.prototype.testExtendUrl = function() { - var url; - elgg.config.wwwroot = "http://www.elgg.org/"; + elgg.config.wwwroot = "http://elgg.org/"; - url = ''; - assertEquals(elgg.config.wwwroot, elgg.extendUrl(url)); - - url = 'pg/test'; - assertEquals('http://www.elgg.org/pg/test', elgg.extendUrl(url)); + var inputs = [ + [elgg.config.wwwroot, ''], + [elgg.config.wwwroot + 'pg/test', 'pg/test'], + ['http://google.com', 'http://google.com'], + ['//example.com', '//example.com'], + ]; + + for (var i in inputs) { + assertEquals(inputs[i][0], elgg.normalize_url(inputs[i][1])); + } }; \ No newline at end of file -- cgit v1.2.3