javascript - Is it possible to use factory_girl.js with teaspoon? -
javascript - Is it possible to use factory_girl.js with teaspoon? -
as part of trying larn web development, have reached point have coffeescript classes test within rails environment.
i have rails 4.03 app have been working on (it based off rails tutorial). during process of learning rails, got used working rspec , factorygirl, seek follow similar flow coffeescript if possible.
i wrote coffeescript individual classes, each in there own file, think should testable.
i have teaspoon installed, looks lot rspec. have working basic tests, need start writing real tests. teaspoon has back upwards fixtures, noticed there node.js bundle called factory_girl, seems port of ruby factorygirl rspec. installed bundle using npm -install , have listed in rails folder under "node_modules".
can tell me if possible utilize bundle generate objects testing teaspoon, , if how?
update: marking reply below accepted, because able factorygirl run. did (as suggested in answer) re-create factory_girl.js file location loaded assets pipeline spec/javascripts/support, , required in spec/javascripts/spec_helper.coffee file.
the problem functionality not seem match happens in rails (unless forgetting how worked in rails). in rails, define mill model , objects created instances of class associating mill with. here there not seem association class trying generated instances of. example, properties define in mill definition available, , none of methods defined on objects. doing wrong , or maybe trying utilize coffeescript breaks somehow.
teaspoon doesn't utilize node (mostly), , rails based in terms of runner foundation. on top of rails layer, uses jasmine, mocha, or qunit browser test frameworks.
trying load node module in not easy, or possible in cases. if factory_girl.js can loaded browser in theory require file (if it's in asset path) within spec helper , utilize want.
disclaimer: i'm primary author of teaspoon, have never used factory_girl.js (but have used factory_girl gem).
javascript ruby-on-rails node.js coffeescript teaspoon
Comments
Post a Comment