From 13f31602f396bc269076ab4d389cfd8ca94b20ba Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 12 Mar 2012 22:56:36 -0700 Subject: feat(ng-list): Allow custom separator --- test/directive/inputSpec.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/directive') diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js index a9aafd04..ad1670f9 100644 --- a/test/directive/inputSpec.js +++ b/test/directive/inputSpec.js @@ -871,6 +871,28 @@ describe('input', function() { changeInputValueTo(''); expect(scope.list).toEqual([]); }); + + + it('should allow custom separator', function() { + compileInput(''); + + changeInputValueTo('a,a'); + expect(scope.list).toEqual(['a,a']); + + changeInputValueTo('a:b'); + expect(scope.list).toEqual(['a', 'b']); + }); + + + it('should allow regexp as a separator', function() { + compileInput(''); + + changeInputValueTo('a,b'); + expect(scope.list).toEqual(['a', 'b']); + + changeInputValueTo('a,b: c'); + expect(scope.list).toEqual(['a', 'b', 'c']); + }); }); describe('required', function() { -- cgit v1.2.3