From 67a4a25b890fada0043c1ff98e5437d793f44d0c Mon Sep 17 00:00:00 2001 From: Lucas Galfasó Date: Tue, 7 May 2013 09:14:57 -0300 Subject: fix(ngPluralize): handle the empty string as a valid override Fix the check for overrides so it is able to handle the empty string Closes #2575 --- test/ng/directive/ngPluralizeSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ng/directive/ngPluralizeSpec.js') diff --git a/test/ng/directive/ngPluralizeSpec.js b/test/ng/directive/ngPluralizeSpec.js index e790518c..0ca2d23e 100644 --- a/test/ng/directive/ngPluralizeSpec.js +++ b/test/ng/directive/ngPluralizeSpec.js @@ -99,6 +99,21 @@ describe('ngPluralize', function() { }); + describe('edge cases', function() { + it('should be able to handle empty strings as possible values', inject(function($rootScope, $compile) { + element = $compile( + '" + + '')($rootScope); + $rootScope.email = '0'; + $rootScope.$digest(); + expect(element.text()).toBe(''); + })); + }); + + describe('deal with pluralized strings with offset', function() { it('should show single/plural strings with offset', inject(function($rootScope, $compile) { element = $compile( -- cgit v1.2.3