Created
October 14, 2014 14:39
-
-
Save cowboyd/972c9db3d9effbff4268 to your computer and use it in GitHub Desktop.
Setting up the store
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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