Permalink
Browse files

can.Model.model doesn't use custom id for store

  • Loading branch information...
daffl committed Apr 9, 2012
1 parent 234fd3b commit 14d05c29e71ed8c462ba49b740d9eb8e342d3c85
Showing with 20 additions and 0 deletions.
  1. +20 −0 model/model_test.js
View
@@ -176,6 +176,26 @@ test("models", function(){
equals(people[0].prettyName(),"Mr. Justin","wraps wrapping works")
});
test(".model with custom id", function() {
can.Model("CustomId", {
id : '_id'
}, {
getName : function() {
return this.name;
}
});
var test = CustomId.model({
_id : 1,
name : 'Justin'
});
equal(test.getName(), 'Justin', 'Wrapping works and name set properly');
var test2 = CustomId.model({
_id : 2,
name : 'Brian'
});
equal(test.getName(), 'Brian', 'Warapped and name set');
});
/*
test("async setters", function(){

0 comments on commit 14d05c2

Please sign in to comment.