I am trying to test a DS.Model using jasmine. I am trying to test that when i create a record it is setup properly.
When i do
bb = App.BuildingBlock.createRecord(name: "Test")
i get the error
Cannot read property ‘createRecord’ of undefined
but if i do
bb = App.BuildingBlock.create(name: "Test")
i get
Error: You should not call
createon a model. Instead, callcreateRecordwith the attributes you would like to set.
So it seems to know its a model ??? Also if i do
expect(App.BuildingBlock).toBeDefined()
it passes.
Anyone help me with this ?
thanks
Rick
Add the following to the top of your spec
Then use
The reason for the errors you’re seeing is that DS.Model aliases createRecord to the store and that is what is undefined.
At the bottom of model.js you will see the following lines: