From 1b27c11c952596c3ec88c566fc3c045c8e28c6b7 Mon Sep 17 00:00:00 2001 From: Nate Abele Date: Thu, 17 Apr 2014 15:41:26 -0400 Subject: [PATCH] Add test to validate null checking on update --- test/modelSpec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/modelSpec.js b/test/modelSpec.js index d795287..2875b44 100644 --- a/test/modelSpec.js +++ b/test/modelSpec.js @@ -571,6 +571,17 @@ describe("model", function() { expect(list.things).toEqualData(['foo']); expect(list.$pristine()).toBe(true); })); + + it('should not choke on null values in arrays', inject(function(model) { + var data = { foo: 'bar' }; + + model('Tasks').create(data).$save(); + + $httpBackend.expectPOST('http://api/tasks', data).respond(200, angular.extend( + { baz: ['gooby', null] }, data + )); + $httpBackend.flush(); + })); }); describe("syncing", function() {