From e85774f709b9f681b0ff8d829b07568b0f844a62 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 19 Jul 2012 01:10:12 -0700 Subject: fix(ngPluralize): fixes ng-pluralize when using non-standard start/end symbols Closes #1134 --- test/ng/directive/ngPluralizeSpec.js | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'test/ng') diff --git a/test/ng/directive/ngPluralizeSpec.js b/test/ng/directive/ngPluralizeSpec.js index c382f4f4..e790518c 100644 --- a/test/ng/directive/ngPluralizeSpec.js +++ b/test/ng/directive/ngPluralizeSpec.js @@ -133,4 +133,41 @@ describe('ngPluralize', function() { expect(element.text()).toBe('Igor, Misko and 2 other people are viewing.'); })); }); + + + describe('interpolation', function() { + + it('should support custom interpolation symbols', function() { + module(function($interpolateProvider) { + $interpolateProvider.startSymbol('[[').endSymbol('%%'); + }); + + inject(function($compile, $rootScope) { + element = $compile( + "" + + "")($rootScope); + $rootScope.p1 = 'Igor'; + + $rootScope.viewCount = 0; + $rootScope.$digest(); + expect(element.text()).toBe('Nobody is viewing.'); + + $rootScope.viewCount = 1; + $rootScope.$digest(); + expect(element.text()).toBe('Igor is viewing.'); + + $rootScope.viewCount = 2; + $rootScope.$digest(); + expect(element.text()).toBe('Igor and one other person are viewing.'); + + $rootScope.viewCount = 3; + $rootScope.$digest(); + expect(element.text()).toBe('Igor and 2 other people are viewing.'); + }); + }) + }); }); -- cgit v1.2.3