aboutsummaryrefslogtreecommitdiffstats
path: root/test_harnesses/automated.html
diff options
context:
space:
mode:
Diffstat (limited to 'test_harnesses/automated.html')
-rw-r--r--test_harnesses/automated.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/test_harnesses/automated.html b/test_harnesses/automated.html
index 5e3ae93c..764b0d2f 100644
--- a/test_harnesses/automated.html
+++ b/test_harnesses/automated.html
@@ -250,6 +250,19 @@
);
+ context("Web query parsing",
+
+ should("Convert query string to valid URL", function() {
+ assert.equal("http://www.google.com/", utils.ensureUrl("http://www.google.com/"));
+ assert.equal("http://www.google.com/", utils.ensureUrl(" http://www.google.com/ "));
+ assert.equal("http://www.google.com", utils.ensureUrl("www.google.com"));
+ assert.equal("http://google.com", utils.ensureUrl("google.com"));
+ assert.equal("http://www.google.com/search?q=google", utils.ensureUrl("google"));
+ assert.equal("http://www.google.com/search?q=go ogle.com", utils.ensureUrl("go ogle.com"));
+ })
+
+ );
+
Tests.outputMethod = function(output) {
var newOutput = Array.prototype.join.call(arguments, "\n");
newOutput = newOutput.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); // escape html