I'm writing unit and integration tests against an Ember.js application, and I can't connect to the server when the application is under test. This means I need to use DS.FixtureAdapter to back up my data store.
But I'm not personally a fan of fixtures in large applications, because it's so hard to come up with a single set of fixtures that work with every test case. I prefer tools like factory_girl and machinist that allow me to generate test-specific data that's isolated from all other tests:
FactoryGirl.define do
factory :user do
name 'John Doe'
date_of_birth { 21.years.ago }
end
end
# In specific test cases:
user = FactoryGirl.build(:user)
young_user = FactoryGirl.create(:user, date_of_birth: 17.years.ago)
Of course, factory_girl and machinist can also generate related models automatically.
Is there any easy way to do this in Ember.js right now? Are there techniques, conventions or libraries which might make this easier? Googling does not real any options yet.