Skip to content

Instantly share code, notes, and snippets.

@joliss
Created June 21, 2012 16:46
Show Gist options
  • Save joliss/2966942 to your computer and use it in GitHub Desktop.
Save joliss/2966942 to your computer and use it in GitHub Desktop.
Ember test setup
App.Dummy = DS.Model.extend()
App.preloadData = (data) ->
App.store.adapter.sideload(App.store, App.Dummy, data, null)
# preloadData is used for both testing and preloading models on page load, delivered through the HTML.
# in test:
fixtureData =
blogs: [
...
]
articles: [
...
]
...
setup ->
App.initializeStore() # App.store.destroy; App.store = ...
App.preloadData fixtureDate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment