Ensure _.where works correctly for nested properties and give indicator arguments more meaningful names.

Former-commit-id: c35e2817125cd852a66066ccdef44bcc40c93e61
This commit is contained in:
John-David Dalton
2013-01-26 23:47:47 -08:00
parent 17fc3c2317
commit 23c3ba6ad7
7 changed files with 204 additions and 191 deletions

View File

@@ -2366,11 +2366,11 @@
test('should deep compare `properties` values', function() {
var collection = [
{ 'a': { 'b': 1 }, 'c': 2 },
{ 'a': { 'b': 2 }, 'c': 3 }
{ 'a': { 'b': 1, 'c': 2 } },
{ 'a': { 'b': 2, 'c': 3 } }
];
deepEqual(_.where(collection, { 'a': { 'b': 1 } }), [{ 'a': { 'b': 1 }, 'c': 2 }]);
deepEqual(_.where(collection, { 'a': { 'b': 1 } }), [{ 'a': { 'b': 1, 'c': 2 } }]);
});
}());