Add isolated spec for calling binding.set() on an iteration binding.
Showing
1 changed file
with
13 additions
and
0 deletions
... | @@ -116,6 +116,19 @@ describe('Rivets.Binding', function() { | ... | @@ -116,6 +116,19 @@ describe('Rivets.Binding', function() { |
116 | expect(binding.routine).toHaveBeenCalledWith(el, funcb, funca); | 116 | expect(binding.routine).toHaveBeenCalledWith(el, funcb, funca); |
117 | }); | 117 | }); |
118 | }); | 118 | }); |
119 | |||
120 | describe('on an iteration binding', function(){ | ||
121 | beforeEach(function(){ | ||
122 | binding.options.special = 'iteration'; | ||
123 | }); | ||
124 | |||
125 | it('performs the binding routine with the supplied collection and binding', function() { | ||
126 | spyOn(binding, 'routine'); | ||
127 | array = [{name: 'a'}, {name: 'b'}]; | ||
128 | binding.set(array); | ||
129 | expect(binding.routine).toHaveBeenCalledWith(el, array, binding); | ||
130 | }); | ||
131 | }); | ||
119 | }); | 132 | }); |
120 | 133 | ||
121 | describe('publish()', function() { | 134 | describe('publish()', function() { | ... | ... |
-
Please register or sign in to post a comment