I have a simple ember application and I want to test it without making a server for API calls.
I inspected the bunch and found this piece of code that helps a lot. Testing problem. I want to use an adapter adapter (it makes sense, right?)
@store = Lfg.__container__.lookup('store:main')
Here is my model:
Lfg.Activity = DS.Model.extend
title: DS.attr('string')
people: DS.attr('number')
maxPeople: DS.attr('number')
host: DS.attr('string')
Then inside a Em.run =>I do it
Lfg.reset()
container = new Ember.Container()
[
'activity'
].forEach (x,i) ->
container.register 'model:'+x, Lfg.get( Ember.String.classify(x) )
@store = DS.Store.create
adapter: DS.FixtureAdapter.extend()
container: container
But I keep getting errors using the serializer. I tried to add a serializer but didn't help. Do I need container.registerother things?
The error I am getting is TypeError: Cannot call method 'serialize' of undefinedthat coming from the mockJSON method more specifically store.serializerFor(type)returns null.
store = Lfg.__container__.lookup('store:main'), store.serializerFor(Lfg.Activity), , - ? , . , .