aboutsummaryrefslogtreecommitdiffstats
path: root/test/servicesSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/servicesSpec.js')
-rw-r--r--test/servicesSpec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js
index b2cac224..6df83beb 100644
--- a/test/servicesSpec.js
+++ b/test/servicesSpec.js
@@ -128,6 +128,18 @@ describe("service", function(){
expect($location.hashSearch).toEqual({key: 'value', flag: true, key2: ''});
});
+
+ it('should update location when browser url changed', function() {
+ var origUrl = $location.href;
+ expect(origUrl).toEqual($browser.getUrl());
+
+ var newUrl = 'http://somenew/url#foo';
+ $browser.setUrl(newUrl);
+ $browser.poll();
+ expect($location.href).toEqual(newUrl);
+ });
+
+
it('toString() should return actual representation', function() {
var href = 'http://host:123/p/a/t/h.html?query=value#path?key=value&flag&key2=';
$location.update(href);