Skip to content

Commit

Permalink
added a test to be sure that newly saved objects get their 'id' field…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
xavierlacot committed Jul 29, 2011
1 parent 5fda905 commit 5b72d8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Resources/test/record.js
Expand Up @@ -13,6 +13,14 @@
setUp();
test.insertCities();
expect(models.city.count()).toBe(2);

// on object saved for the first time gets his primary key immediately available
var berlin = models.city.newRecord({
name: 'Berlin',
description: 'A nice place to live'
})
berlin.save();
expect(berlin.get('id')).toBeGreaterThan(0);
});

it('joli.record.get()', function() {
Expand Down

0 comments on commit 5b72d8b

Please sign in to comment.