Testing Rails + Backbone.js application

I am working on a Rails application that also uses Backbone. I am testing the clean Rails part with Cucumber and RSpec, and I am looking for something similar to the Backbone test part.

I tried to use Jasmine, but it was unsuccessful due to the lack of documentation for Ruby gem. I'm currently considering using an external application (like RobotFramework, an automated test tool that I used in a previous project) that uses Selenium RC, but I'm not sure if this is the best way. Are there any better tools?

+4
source share
3 answers

For high-level bdd integration testing, iafonov is correct. cucumber and related things (selenium, capybara) work fine. If you do not need such human-readable tests, there is also a steak stone (https://github.com/cavalle/steak). I have not used it, but it seems reasonable.

If you need more unit test as behavior for js, then I suggest Jasmine. I used it and it worked great for me. I especially liked how close it is to rspec syntax.

Perhaps if you post the problems you have, we can help with this?

+2
source

Why not use cucumber + selenium or capybara-webkit for acceptance tests / bdd?

+1
source

I highly recommend using jasmine and jasminerice gemstones. You can find a good example in my blog post: http://blog.bandzarewicz.com/blog/2012/03/08/backbone-dot-js-tdd-with-jasmine-part-one-the-model

0
source

All Articles