Fix the preloadData spec.
Showing
1 changed file
with
3 additions
and
5 deletions
... | @@ -8,7 +8,7 @@ describe('Rivets.Binding', function() { | ... | @@ -8,7 +8,7 @@ describe('Rivets.Binding', function() { |
8 | el = document.createElement('div'); | 8 | el = document.createElement('div'); |
9 | el.setAttribute('data-text', 'obj.name'); | 9 | el.setAttribute('data-text', 'obj.name'); |
10 | 10 | ||
11 | view = rivets.bind(el, {obj: {}}); | 11 | view = rivets.bind(el, {obj: {name: 'test'}}); |
12 | binding = view.bindings[0]; | 12 | binding = view.bindings[0]; |
13 | model = binding.model; | 13 | model = binding.model; |
14 | }); | 14 | }); |
... | @@ -40,12 +40,10 @@ describe('Rivets.Binding', function() { | ... | @@ -40,12 +40,10 @@ describe('Rivets.Binding', function() { |
40 | rivets.config.preloadData = true; | 40 | rivets.config.preloadData = true; |
41 | }); | 41 | }); |
42 | 42 | ||
43 | it('sets the initial value via the adapter', function() { | 43 | it('sets the initial value', function() { |
44 | spyOn(binding, 'set'); | 44 | spyOn(binding, 'set'); |
45 | spyOn(adapter, 'read'); | ||
46 | binding.bind(); | 45 | binding.bind(); |
47 | expect(adapter.read).toHaveBeenCalledWith(model, 'name'); | 46 | expect(binding.set).toHaveBeenCalledWith('test'); |
48 | expect(binding.set).toHaveBeenCalled(); | ||
49 | }); | 47 | }); |
50 | }); | 48 | }); |
51 | 49 | ... | ... |
-
Please register or sign in to post a comment