aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2014-01-27 17:35:27 -0800
committerIgor Minar2014-01-31 03:16:46 -0800
commit339a1658cd9bfa5e322a01c45aa0a1df67e3a842 (patch)
tree28d6bd6dc0005fad0c6f3e3c28721dbc7529091e /test
parent29432ffe3795477d8f6174cee1976683ded89d67 (diff)
downloadangular.js-339a1658cd9bfa5e322a01c45aa0a1df67e3a842.tar.bz2
fix(filterFilter): don't interpret dots in predicate object fields as paths
Closes #6005 Closes #6009
Diffstat (limited to 'test')
-rw-r--r--test/ng/filter/filterSpec.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ng/filter/filterSpec.js b/test/ng/filter/filterSpec.js
index cab24ec5..0bb48704 100644
--- a/test/ng/filter/filterSpec.js
+++ b/test/ng/filter/filterSpec.js
@@ -60,6 +60,16 @@ describe('Filter: filter', function() {
expect(filter(items, {first:'misko', last:'hevery'})[0]).toEqual(items[0]);
});
+
+ it('should support predicat object with dots in the name', function() {
+ var items = [{'first.name': 'misko', 'last.name': 'hevery'},
+ {'first.name': 'adam', 'last.name': 'abrons'}];
+
+ expect(filter(items, {'first.name':'', 'last.name':''}).length).toBe(2);
+ expect(filter(items, {'first.name':'misko', 'last.name':''})).toEqual([items[0]]);
+ });
+
+
it('should match any properties for given "$" property', function() {
var items = [{first: 'tom', last: 'hevery'},
{first: 'adam', last: 'hevery', alias: 'tom', done: false},