aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng
diff options
context:
space:
mode:
authorThibault Leruitte2012-04-04 16:41:50 +0200
committerIgor Minar2012-04-11 17:27:32 -0700
commit0a5050eb3c1f1ed84134f23a44b97a7261114060 (patch)
tree80ec2ec9fd80ca8be556fe8f95732256cfb80b3d /test/ng
parent7c430c5ed039d7eed8d71bd107708224c1db5c74 (diff)
downloadangular.js-0a5050eb3c1f1ed84134f23a44b97a7261114060.tar.bz2
fix($location): don't rewrite links to different base paths
links to different base paths should not be left untouched
Diffstat (limited to 'test/ng')
-rw-r--r--test/ng/locationSpec.js82
1 files changed, 82 insertions, 0 deletions
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js
index 18f884fe..98167b4e 100644
--- a/test/ng/locationSpec.js
+++ b/test/ng/locationSpec.js
@@ -864,6 +864,88 @@ describe('$location', function() {
});
+ it('should not rewrite when link to different base path when history enabled on new browser',
+ function() {
+ configureService('/other_base/link', true, true);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
+ it('should not rewrite when link to different base path when history enabled on old browser',
+ function() {
+ configureService('/other_base/link', true, false);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
+ it('should not rewrite when link to different base path when history disabled', function() {
+ configureService('/other_base/link', false);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
+ it('should not rewrite when full link to different base path when history enabled on new browser',
+ function() {
+ configureService('http://host.com/other_base/link', true, true);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
+ it('should not rewrite when full link to different base path when history enabled on old browser',
+ function() {
+ configureService('http://host.com/other_base/link', true, false);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
+ it('should not rewrite when full link to different base path when history disabled', function() {
+ configureService('http://host.com/other_base/link', false);
+ inject(
+ initBrowser(),
+ initLocation(),
+ function($browser) {
+ browserTrigger(link, 'click');
+ expectNoRewrite($browser);
+ }
+ );
+ });
+
+
// don't run next tests on IE<9, as browserTrigger does not simulate pressed keys
if (!(msie < 9)) {