diff options
Diffstat (limited to 'test/ng/directive/booleanAttrsSpec.js')
| -rw-r--r-- | test/ng/directive/booleanAttrsSpec.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/ng/directive/booleanAttrsSpec.js b/test/ng/directive/booleanAttrsSpec.js index 0ce6b555..aa48afff 100644 --- a/test/ng/directive/booleanAttrsSpec.js +++ b/test/ng/directive/booleanAttrsSpec.js @@ -88,7 +88,6 @@ describe('boolean attr directives', function() { describe('ngSrc', function() { - it('should interpolate the expression and bind to src', inject(function($compile, $rootScope) { var element = $compile('<div ng-src="some/{{id}}"></div>')($rootScope); @@ -126,6 +125,23 @@ describe('ngSrc', function() { }); +describe('ngSrcset', function() { + it('should interpolate the expression and bind to srcset', inject(function($compile, $rootScope) { + var element = $compile('<div ng-srcset="some/{{id}} 2x"></div>')($rootScope); + + $rootScope.$digest(); + expect(element.attr('srcset')).toEqual('some/ 2x'); + + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(element.attr('srcset')).toEqual('some/1 2x'); + + dealoc(element); + })); +}); + + describe('ngHref', function() { var element; |
