Skip to content

Commit 1b27c11

Browse files
committed
Add test to validate null checking on update
1 parent cd9d882 commit 1b27c11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/modelSpec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,17 @@ describe("model", function() {
571571
expect(list.things).toEqualData(['foo']);
572572
expect(list.$pristine()).toBe(true);
573573
}));
574+
575+
it('should not choke on null values in arrays', inject(function(model) {
576+
var data = { foo: 'bar' };
577+
578+
model('Tasks').create(data).$save();
579+
580+
$httpBackend.expectPOST('http://api/tasks', data).respond(200, angular.extend(
581+
{ baz: ['gooby', null] }, data
582+
));
583+
$httpBackend.flush();
584+
}));
574585
});
575586

576587
describe("syncing", function() {

0 commit comments

Comments
 (0)