diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-07-22 17:01:57 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-07-22 17:07:29 +0300 |
commit | bc3f33f92a16d3afdb8a472f60940e7c46a31564 (patch) | |
tree | c6e568504b7888591ad15586bb1ace99db8941ca /spec/javascripts/extensions/jquery_spec.js | |
parent | 033e5423a2594e08a7ebcd2379bd2331f4c39032 (diff) | |
download | gitlab-ce-jsify.tar.gz |
JSify all the things!jsify
Diffstat (limited to 'spec/javascripts/extensions/jquery_spec.js')
-rw-r--r-- | spec/javascripts/extensions/jquery_spec.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/javascripts/extensions/jquery_spec.js b/spec/javascripts/extensions/jquery_spec.js new file mode 100644 index 00000000000..87581f24031 --- /dev/null +++ b/spec/javascripts/extensions/jquery_spec.js @@ -0,0 +1,38 @@ + +/*= require extensions/jquery */ +describe('jQuery extensions', function() { + describe('disable', function() { + beforeEach(function() { + return fixture.set('<input type="text" />'); + }); + it('adds the disabled attribute', function() { + var $input; + $input = $('input').first(); + $input.disable(); + return expect($input).toHaveAttr('disabled', 'disabled'); + }); + return it('adds the disabled class', function() { + var $input; + $input = $('input').first(); + $input.disable(); + return expect($input).toHaveClass('disabled'); + }); + }); + return describe('enable', function() { + beforeEach(function() { + return fixture.set('<input type="text" disabled="disabled" class="disabled" />'); + }); + it('removes the disabled attribute', function() { + var $input; + $input = $('input').first(); + $input.enable(); + return expect($input).not.toHaveAttr('disabled'); + }); + return it('removes the disabled class', function() { + var $input; + $input = $('input').first(); + $input.enable(); + return expect($input).not.toHaveClass('disabled'); + }); + }); +}); |