aboutsummaryrefslogtreecommitdiffstats
path: root/test/directive/inputSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/directive/inputSpec.js')
-rw-r--r--test/directive/inputSpec.js22
1 files changed, 22 insertions, 0 deletions
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('<input type="text" ng-model="list" ng-list=":" />');
+
+ 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('<input type="text" ng-model="list" ng-list="/:|,/" />');
+
+ changeInputValueTo('a,b');
+ expect(scope.list).toEqual(['a', 'b']);
+
+ changeInputValueTo('a,b: c');
+ expect(scope.list).toEqual(['a', 'b', 'c']);
+ });
});
describe('required', function() {