diff options
Diffstat (limited to 'test/directivesSpec.js')
| -rw-r--r-- | test/directivesSpec.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index ab1813c3..ef8241f1 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -104,10 +104,17 @@ describe("directive", function(){ }); - it('should ng:bind-attr', function(){ - var scope = compile('<img ng:bind-attr="{src:\'http://localhost/mysrc\', alt:\'myalt\'}"/>'); - expect(element.attr('src')).toEqual('http://localhost/mysrc'); - expect(element.attr('alt')).toEqual('myalt'); + describe('ng:bind-attr', function(){ + it('should bind attributes', function(){ + var scope = compile('<img ng:bind-attr="{src:\'http://localhost/mysrc\', alt:\'myalt\'}"/>'); + expect(element.attr('src')).toEqual('http://localhost/mysrc'); + expect(element.attr('alt')).toEqual('myalt'); + }); + + it('should not pretty print JSON in attributes', function(){ + var scope = compile('<img alt="{{ {a:1} }}"/>'); + expect(element.attr('alt')).toEqual('{"a":1}'); + }); }); it('should remove special attributes on false', function(){ |
