Skip to content

Commit

Permalink
Add test to validate null checking on update
Browse files Browse the repository at this point in the history
  • Loading branch information
nateabele committed Apr 17, 2014
1 parent cd9d882 commit 1b27c11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/modelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 1b27c11

Please sign in to comment.