aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLucas Galfasó2013-05-07 09:14:57 -0300
committerPete Bacon Darwin2013-05-10 20:04:59 +0100
commit42ce8f7f556808da3947aa0bb1c448bbe970bd36 (patch)
tree3e4ebe64268514554ddb53280b9024ea955d6b41 /test
parent661390aef361c728ea68a699d60de5807d2fb5a8 (diff)
downloadangular.js-42ce8f7f556808da3947aa0bb1c448bbe970bd36.tar.bz2
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
Diffstat (limited to 'test')
-rw-r--r--test/ng/directive/ngPluralizeSpec.js15
1 files changed, 15 insertions, 0 deletions
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(
+ '<ng:pluralize count="email"' +
+ "when=\"{'0': ''," +
+ "'one': 'Some text'," +
+ "'other': 'Some text'}\">" +
+ '</ng:pluralize>')($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(