Update binding spec to adhere to the new formatters API.
Showing
1 changed file
with
3 additions
and
9 deletions
... | @@ -78,9 +78,7 @@ describe('Rivets.Binding', function() { | ... | @@ -78,9 +78,7 @@ describe('Rivets.Binding', function() { |
78 | }); | 78 | }); |
79 | 79 | ||
80 | it('applies any formatters to the value before performing the routine', function() { | 80 | it('applies any formatters to the value before performing the routine', function() { |
81 | rivets.config.formatters = { | 81 | rivets.formatters.awesome = function(value) { return 'awesome ' + value }; |
82 | awesome: function(value) { return 'awesome ' + value } | ||
83 | }; | ||
84 | binding.formatters.push('awesome'); | 82 | binding.formatters.push('awesome'); |
85 | spyOn(binding, 'routine'); | 83 | spyOn(binding, 'routine'); |
86 | binding.set('sweater'); | 84 | binding.set('sweater'); |
... | @@ -133,9 +131,7 @@ describe('Rivets.Binding', function() { | ... | @@ -133,9 +131,7 @@ describe('Rivets.Binding', function() { |
133 | 131 | ||
134 | describe('formattedValue()', function() { | 132 | describe('formattedValue()', function() { |
135 | it('applies the current formatters on the supplied value', function() { | 133 | it('applies the current formatters on the supplied value', function() { |
136 | rivets.config.formatters = { | 134 | rivets.formatters.awesome = function(value) { return 'awesome ' + value }; |
137 | awesome: function(value) { return 'awesome ' + value } | ||
138 | }; | ||
139 | binding.formatters.push('awesome'); | 135 | binding.formatters.push('awesome'); |
140 | expect(binding.formattedValue('hat')).toBe('awesome hat'); | 136 | expect(binding.formattedValue('hat')).toBe('awesome hat'); |
141 | }); | 137 | }); |
... | @@ -148,10 +144,8 @@ describe('Rivets.Binding', function() { | ... | @@ -148,10 +144,8 @@ describe('Rivets.Binding', function() { |
148 | 144 | ||
149 | describe('with a multi-argument formatter string', function() { | 145 | describe('with a multi-argument formatter string', function() { |
150 | beforeEach(function() { | 146 | beforeEach(function() { |
151 | rivets.config.formatters = { | 147 | rivets.formatters.awesome = function(value, prefix) { |
152 | awesome: function(value, prefix) { | ||
153 | return prefix + ' awesome ' + value; | 148 | return prefix + ' awesome ' + value; |
154 | } | ||
155 | }; | 149 | }; |
156 | binding.formatters.push('awesome super'); | 150 | binding.formatters.push('awesome super'); |
157 | }); | 151 | }); | ... | ... |
-
Please register or sign in to post a comment