Permalink
Browse files

Added spec for #2108.

  • Loading branch information...
1 parent 1bca15d commit 0f2f03714f90cf3457f466aca9210d9c05ec1351 @ibolmo ibolmo committed Nov 29, 2011
Showing with 12 additions and 4 deletions.
  1. +12 −4 1.4client/Element/Element.js
@@ -174,15 +174,18 @@ describe('Element', function(){
describe('Element.erase', function(){
- var subject, image;
+ var elements, subject, image, textarea;
beforeEach(function(){
- subject = new Element('div').inject(document.body);
- image = new Element('img').inject(document.body);
+ elements = [
+ subject = new Element('div'),
+ image = new Element('img'),
+ textarea = new Element('div', {html: '<textarea id="t1">hello</textarea>'}).getFirst()
+ ].invoke('inject', document.body);
});
afterEach(function(){
- [subject, image].invoke('destroy');
+ elements.invoke('destroy');
});
it('should erase the class of an Element', function(){
@@ -203,6 +206,11 @@ describe('Element', function(){
expect(subject.get('random')).toEqual(null);
});
+ it('should erase the value attribute of a textarea', function(){
+ textarea.erase('value');
+ expect(textarea.get('value')).toEqual('');
+ });
+
});
});

0 comments on commit 0f2f037

Please sign in to comment.