aboutsummaryrefslogtreecommitdiffstats
path: root/test/directivesSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2012-01-12 11:06:10 -0800
committerMisko Hevery2012-01-12 13:40:07 -0800
commitd648d709f3edcac56132e9e2a84a0fc65f5b48ac (patch)
treeac0ba5763838a4f4b880dc72f0cbcedc1b7abc05 /test/directivesSpec.js
parent9a8dbfef5151e8e92dc010a597b670e7687ebe9b (diff)
downloadangular.js-d648d709f3edcac56132e9e2a84a0fc65f5b48ac.tar.bz2
refactor(module): strict separation between module-config / app-runtime
Diffstat (limited to 'test/directivesSpec.js')
-rw-r--r--test/directivesSpec.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index ffb6d57c..1825dc49 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -2,6 +2,12 @@
describe("directive", function() {
+ var $filterProvider;
+
+ beforeEach(module(['$filterProvider', function(provider){
+ $filterProvider = provider;
+ }]));
+
it("should ng:init", inject(function($rootScope, $compile) {
var element = $compile('<div ng:init="a=123"></div>')($rootScope);
expect($rootScope.a).toEqual(123);
@@ -41,7 +47,7 @@ describe("directive", function() {
expect(lowercase(element.html())).toEqual('<div onclick="">hello</div>');
}));
- it('should set element element', inject(function($rootScope, $compile, $filterProvider) {
+ it('should set element element', inject(function($rootScope, $compile) {
$filterProvider.register('myElement', valueFn(function() {
return jqLite('<a>hello</a>');
}));
@@ -73,7 +79,7 @@ describe("directive", function() {
expect(element.text()).toEqual('Hello Misko!');
}));
- it('should have $element set to current bind element', inject(function($rootScope, $compile, $filterProvider) {
+ it('should have $element set to current bind element', inject(function($rootScope, $compile) {
var innerText;
$filterProvider.register('myFilter', valueFn(function(text) {
innerText = innerText || this.$element.text();
@@ -415,7 +421,7 @@ describe("directive", function() {
scope.$apply();
expect(element.css(preCompStyle)).not.toBe('88px');
expect(element.css(postCompStyle)).not.toBe('99px');
- });
+ });
});
});