We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 234fd3b commit 14d05c2Copy full SHA for 14d05c2
model/model_test.js
@@ -176,6 +176,26 @@ test("models", function(){
176
equals(people[0].prettyName(),"Mr. Justin","wraps wrapping works")
177
});
178
179
+test(".model with custom id", function() {
180
+ can.Model("CustomId", {
181
+ id : '_id'
182
+ }, {
183
+ getName : function() {
184
+ return this.name;
185
+ }
186
+ });
187
+ var test = CustomId.model({
188
+ _id : 1,
189
+ name : 'Justin'
190
191
+ equal(test.getName(), 'Justin', 'Wrapping works and name set properly');
192
+ var test2 = CustomId.model({
193
+ _id : 2,
194
+ name : 'Brian'
195
196
+ equal(test.getName(), 'Brian', 'Warapped and name set');
197
+});
198
+
199
200
/*
201
test("async setters", function(){
0 commit comments