Closed meleyal closed 11 years ago
I'm using Mocha.js for my Backbone testing in Rails and it is really nice. The Should style assertions with Chai.js are beautiful. My glue code for asset pipeline is available as a rails engine: https://github.com/quartzmo/mocha_rails. What do you think about a scaffold generator option for Mocha tests in backbone-on-rails?
This was more of a note-to-self to write some unit tests for the generators, I've updated the title so it's more clear.
Mocha tests are a nice idea, though I've never used them myself. So backbone-on-rails
would provide the generators, and mocha_rails
the glue code to run them?
The idea (credit to phaedryx) is that the backbone-on-rails generators, either through an option or through detection of JS test gems gems like mocha_rails or Jasminerice, would then generate the right type of tests, similar to how Rails does for Rspec or testunit.
Could you open another issue for this?
Small update regarding the testing of backbone-coffee code, see: https://github.com/meleyal/backbone-on-rails/issues/19
@quartzmo there's now a separate issue #19 for this, definitely something we should add.
@mulderp any chance you could make a separate pull request with your unit tests from https://github.com/meleyal/backbone-on-rails/pull/27?
I currently don't have time to work on this, but we could really do with some tests!
Tests are now merged in master.
See:
http://nicksda.apotomo.de/2010/09/getting-a-bloody-rails-3-generator-running-and-testing-it/ https://github.com/plataformatec/devise/tree/master/test/generators https://github.com/ryanb/nifty-generators/tree/master/test https://github.com/codebrew/backbone-rails/tree/master/test/generators