meleyal / backbone-on-rails

A simple gem for using Backbone.js with Rails.
MIT License
809 stars 125 forks source link

Add unit tests for generators #5

Closed meleyal closed 11 years ago

meleyal commented 12 years ago

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

quartzmo commented 12 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?

meleyal commented 12 years ago

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?

quartzmo commented 12 years ago

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.

meleyal commented 12 years ago

Could you open another issue for this?

meleyal commented 12 years ago

Started work on unit tests for the generators in the tests branch

mulderp commented 12 years ago

Small update regarding the testing of backbone-coffee code, see: https://github.com/meleyal/backbone-on-rails/issues/19

meleyal commented 12 years ago

@quartzmo there's now a separate issue #19 for this, definitely something we should add.

meleyal commented 12 years ago

@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!

meleyal commented 11 years ago

Tests are now merged in master.