aboutsummaryrefslogtreecommitdiffstats
path: root/test/UrlWatcherTest.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-31 17:56:16 -0700
committerMisko Hevery2010-03-31 18:18:10 -0700
commit11a6431f8926c557f3c58408dacc98466e76cde1 (patch)
treeab36304fd373d0947ca36c577e25ca87a1c894af /test/UrlWatcherTest.js
parent35a91085004e31f786df1e0011bc26ed0142ab4d (diff)
downloadangular.js-11a6431f8926c557f3c58408dacc98466e76cde1.tar.bz2
started to add services
Diffstat (limited to 'test/UrlWatcherTest.js')
-rw-r--r--test/UrlWatcherTest.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/UrlWatcherTest.js b/test/UrlWatcherTest.js
new file mode 100644
index 00000000..6080ca62
--- /dev/null
+++ b/test/UrlWatcherTest.js
@@ -0,0 +1,25 @@
+UrlWatcherTest = TestCase('UrlWatcherTest');
+
+UrlWatcherTest.prototype.testUrlWatcher = function () {
+ expectAsserts(2);
+ var location = {href:"http://server", hash:""};
+ var watcher = new UrlWatcher(location);
+ watcher.delay = 1;
+ watcher.watch(function(url){
+ assertEquals('http://getangular.test', url);
+ });
+ watcher.setTimeout = function(fn, delay){
+ assertEquals(1, delay);
+ location.href = "http://getangular.test";
+ watcher.setTimeout = function(fn, delay) {
+ };
+ fn();
+ };
+ watcher.start();
+};
+
+FunctionTest = TestCase("FunctionTest");
+
+FunctionTest.prototype.testEscapeHtml = function () {
+ assertEquals("&lt;div&gt;&amp;amp;&lt;/div&gt;", escapeHtml('<div>&amp;</div>'));
+};