SupportBee / Backbone-Factory

A factory for creating backbone objects for testing
86 stars 20 forks source link

Passing options to model initializers #2

Open ejosafat opened 12 years ago

ejosafat commented 12 years ago

You can't pass options to Backbone.Model initializer, can you?

unamashana commented 12 years ago

Sorry. I don't understand. What do you mean? Can you give an example?

ejosafat commented 12 years ago

something like:

var userWithEmail = BackboneFactory.create('user', { email: 'overriden@example.com' }, { collection : users }})

I've implemented it in my fork of your project. Your idea of FactoryGirl for javascript is quite useful! thanks!