In general I'm trying to test my ember models with jasmine. In Ember Data 1.0.0 we no longer have App.Model.find
or App.Model.createRecord
. Instead we have this.get('store').find
and this.get('store').createRecord('model', {})
.
How can I get a handle on the store in my tests?
injecting store
I've looked into injecting it but haven't had luck.
Encompass.inject(this, 'store', 'store');
I think this is because the object I'm injecting into this
isn't the right type.
creating store
I've also tried creating a store locally:
describe("A Folder", function() {
var store = null;
var folder = null;
beforeEach(function(){
Encompass.Store = DS.Store.extend({
adapter: Encompass.ApplicationAdapter
});
store = Encompass.Store.create();
});
but using the store as in
store.find('folder');
results in TypeError: Cannot call method 'lookupFactory' of undefined
I think this is because the container doesn't exist (in time?)