From df72852f3496d7640bb4f70837338e464b7ed69f Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 12 Apr 2012 02:15:36 -0700 Subject: fix(e2eRunner): $browser.location should delegate to apps $location previously it would create a new instance which wasn't configured as the one in the app, which resulted in incorrect values being returned in html5 mode with base url set --- test/ngScenario/dslSpec.js | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'test/ngScenario/dslSpec.js') diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js index fee5c3b5..eef8c907 100644 --- a/test/ngScenario/dslSpec.js +++ b/test/ngScenario/dslSpec.js @@ -168,23 +168,14 @@ describe("angular.scenario.dsl", function() { }); describe('location', function() { - beforeEach(function() { - $window.angular.injector = function() { - return { - get: function(serviceId) { - if (serviceId == '$location') { - return { - url: function() {return '/path?search=a#hhh';}, - path: function() {return '/path';}, - search: function() {return {search: 'a'};}, - hash: function() {return 'hhh';} - }; - } - throw new Error('unknown service id ' + serviceId); - } - }; - }; - }); + beforeEach(inject(function($injector) { + angular.extend($injector.get('$location'), { + url: function() {return '/path?search=a#hhh';}, + path: function() {return '/path';}, + search: function() {return {search: 'a'};}, + hash: function() {return 'hhh';} + }); + })); it('should return full url', function() { $root.dsl.browser().location().url(); -- cgit v1.2.3