Skip to content

Commit

Permalink
Add breaking test for sideloading data with camel cased attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bengillies committed Jun 14, 2013
1 parent 6e8899b commit 11bf239
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/ember-model/tests/model_sideloading_test.js
Expand Up @@ -7,17 +7,21 @@ test("data can be sideloaded without materializing records", function() {

var Model = Ember.Model.extend({
id: attr(),
name: attr()
name: attr(),
camelCase: attr()
});
Model.adapter = {
find: function(record, id) {
ok(false, "Adapter#find shouldn't be called for records with sideloaded data");
}
};

Model.load([{id: 1, name: "Erik"}]);
Model.load([{id: 1, name: "Erik", camel_case: "Dromedary"}]);

var record = Model.find(1);
ok(record.get('isLoaded'), "Record should be loaded immediately");
strictEqual(record.get('id'), 1, "Record ID retained successfully");
strictEqual(record.get('name'), "Erik", "Record name retained successfully");
strictEqual(record.get('camelCase'), "Dromedary", "camel cased attributes retained correctly");
// ok(record.get('isLoaded'), "Record should be loaded immediately");
});
});

0 comments on commit 11bf239

Please sign in to comment.