Testing Rails + Backbone.js application
I am working on Rails application, that also uses Backbone. I am testing the pure Rails part with Cucumber and RSpec and I'm looking for something similar to test Backbone par开发者_C百科t.
I tried to use Jasmine, but it was unsuccessful due to lack of documentation for Ruby gem. I am currently considering using external application (like RobotFramework, a tool for automatic tests I used in previous project) that uses Selenium RC, but I am not convinced it's the best way. Are there any better tools?
For the high level bdd integration testing stuff, iafonov is correct. cucumber, and its associated things (selenium, capybara) work great. If you don't need such human readable tests, there's also steak gem(https://github.com/cavalle/steak). I've not used it, but it seems reasonable.
If you want more unit test like behavior for your js, then I do suggest Jasmine. I've used it, and it worked great for me. I especially liked how closely it resembles the rspec syntax.
Maybe if you posted the problems you're having, we could help with that?
Why not using cucumber + selenium or capybara-webkit for acceptance tests/bdd?
I strongly recommend use jasmine and jasminerice gems. You can find a nice example on my blog post: http://blog.bandzarewicz.com/blog/2012/03/08/backbone-dot-js-tdd-with-jasmine-part-one-the-model
精彩评论