aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/locationSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-11-01 21:09:54 -0700
committerMisko Hevery2011-11-14 16:39:32 -0800
commited36b9da3be338fe9eb36f3eeea901d6f51cd768 (patch)
treeffdc924e4b1fc1c6912674c82e029bf975ca9fca /test/service/locationSpec.js
parentc925f8a6578e05c8136c206f2fd98eeaaf1c0f16 (diff)
downloadangular.js-ed36b9da3be338fe9eb36f3eeea901d6f51cd768.tar.bz2
refactor(injector): switch to injector 2.0 introduce modules
Diffstat (limited to 'test/service/locationSpec.js')
-rw-r--r--test/service/locationSpec.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js
index 38df2619..65ca36a7 100644
--- a/test/service/locationSpec.js
+++ b/test/service/locationSpec.js
@@ -308,13 +308,9 @@ describe('$location', function() {
function initService(html5Mode, hashPrefix, supportHistory) {
- return function(service){
- service('$locationConfig', function(){
- return {html5Mode: html5Mode, hashPrefix: hashPrefix};
- });
- service('$sniffer', function(){
- return {history: supportHistory};
- });
+ return function($provide){
+ $provide.value('$locationConfig', {html5Mode: html5Mode, hashPrefix: hashPrefix});
+ $provide.value('$sniffer', {history: supportHistory});
};
}
function initBrowser(url, basePath) {
@@ -580,7 +576,7 @@ describe('$location', function() {
var root, link, originalBrowser, lastEventPreventDefault;
function configureService(linkHref, html5Mode, supportHist, attrs, content) {
- return function(service){
+ return function($provide){
var jqRoot = jqLite('<div></div>');
attrs = attrs ? ' ' + attrs + ' ' : '';
link = jqLite('<a href="' + linkHref + '"' + attrs + '>' + content + '</a>')[0];
@@ -588,9 +584,9 @@ describe('$location', function() {
jqLite(document.body).append(jqRoot);
- service('$document', function(){ return jqRoot; });
- service('$sniffer', function(){ return {history: supportHist}; });
- service('$locationConfig', function(){ return {html5Mode: html5Mode, hashPrefix: '!'}; });
+ $provide.value('$document', jqRoot);
+ $provide.value('$sniffer', {history: supportHist});
+ $provide.value('$locationConfig', {html5Mode: html5Mode, hashPrefix: '!'});
};
}