diff options
| author | Misko Hevery | 2011-01-13 10:35:26 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-01-14 10:30:00 -0800 |
| commit | 347be5ae9aa6829427e1e8e1b1e58afdf2a36c0a (patch) | |
| tree | 3b350a12378c1ec63f60cce0fe674186d204726e /test/directivesSpec.js | |
| parent | 934f44f69e94a77a3ea6c19dc5c6f82ade2cc669 (diff) | |
| download | angular.js-347be5ae9aa6829427e1e8e1b1e58afdf2a36c0a.tar.bz2 | |
fixed select with ng:format
select (one/multiple) could not chose from a list of objects, since DOM requires string ids.
Solved by adding index formatter, which exposed incorrect handling of formatters in select
widgets.
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(){ |
