Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Created October 14, 2014 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowboyd/972c9db3d9effbff4268 to your computer and use it in GitHub Desktop.
Save cowboyd/972c9db3d9effbff4268 to your computer and use it in GitHub Desktop.
Setting up the store
# We generally use Mocha not QUnit, so ymmv.
# Basically, make the store available for all test cases so
# they can do setup.
#
# creating fixture data has always been a problem for us, and
# we have yet to find the "sweet" solution
#
# This goes in global spec helper
beforeEach ->
@store = App.__container__.lookup("store:main")
# Then, in your test cases, you can use it.
describe "something that needs a post", ->
beforeEach ->
@post = @store.createRecord('post', {author: 'bob'})
it "can use it", ->
# test goes here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment