85eb25be by Michael Richards

Add specs for the selected and unselected binding routines.

1 parent bb827d5c
...@@ -169,6 +169,38 @@ describe('Rivets', function() { ...@@ -169,6 +169,38 @@ describe('Rivets', function() {
169 }); 169 });
170 }); 170 });
171 }); 171 });
172
173 describe('selected', function() {
174 describe('with a truthy value', function() {
175 it('selects the element', function() {
176 rivets.routines.selected(el, true);
177 expect(el.selected).toBe(true);
178 });
179 });
180
181 describe('with a falsey value', function() {
182 it('unselects the element', function() {
183 rivets.routines.selected(el, false);
184 expect(el.selected).toBe(false);
185 });
186 });
187 });
188
189 describe('unselected', function() {
190 describe('with a truthy value', function() {
191 it('unselects the element', function() {
192 rivets.routines.unselected(el, true);
193 expect(el.selected).toBe(false);
194 });
195 });
196
197 describe('with a falsey value', function() {
198 it('selects the element', function() {
199 rivets.routines.unselected(el, false);
200 expect(el.selected).toBe(true);
201 });
202 });
203 });
172 }); 204 });
173 205
174 describe('Binds', function() { 206 describe('Binds', function() {
......