aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-04-21 16:32:05 -0700
committerMisko Hevery2011-06-08 13:49:11 -0700
commitcc9f1fdf38bb179166212382b33e78255e669e73 (patch)
treecb9881186ce11f18c985e93e75a20b4601851f60 /test/jqLiteSpec.js
parentf243c6aeda4c7dc87dac495dfb8942f4c8ba675e (diff)
downloadangular.js-cc9f1fdf38bb179166212382b33e78255e669e73.tar.bz2
Proper handling of special attributes in jqlite
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 3486fbbb..5aec0cff 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -128,7 +128,7 @@ describe('jqLite', function(){
describe('attr', function(){
- it('shoul read wirite and remove attr', function(){
+ it('shoul read write and remove attr', function(){
var selector = jqLite([a, b]);
expect(selector.attr('prop', 'value')).toEqual(selector);
@@ -147,6 +147,21 @@ describe('jqLite', function(){
expect(jqLite(a).attr('prop')).toBeFalsy();
expect(jqLite(b).attr('prop')).toBeFalsy();
});
+
+ it('should read special attributes as boolean', function(){
+ var select = jqLite('<select>');
+ expect(select.attr('multiple')).toEqual(false);
+ expect(jqLite('<select multiple>').attr('multiple')).toEqual(true);
+ expect(jqLite('<select multiple="">').attr('multiple')).toEqual(true);
+ expect(jqLite('<select multiple="x">').attr('multiple')).toEqual(true);
+
+ select.attr('multiple', false);
+ expect(select.attr('multiple')).toEqual(false);
+
+ select.attr('multiple', true);
+ expect(select.attr('multiple')).toEqual(true);
+ });
+
});