please checkout konacha-chai-matchers. It is far more complete! see https://github.com/matthijsgroen/konacha-chai-matchers
- Adds Chai matchers to assert changes
- Adds Chai matchers for common backbone assertions
- Adds support for Factories
Add this line to your application's Gemfile:
gem 'chai-backbone-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install chai-backbone-rails
The provided libraries have dependencies to backbone, underscore and sinon
to install these dependencies, you can add the following to your
Gemfile
:
gem 'sinonjs-rails'
gem 'rails-backbone'
and in your spec_helper
:
#= require sinon/sinon-1.5.0
#= require underscore
#= require backbone
#= require chai-backbone-rails
to run all specs of the libraries:
#= require chai-backbone-rails-spec
#= require chai-changes
See the Chai-changes plugin page
#= require chai-backbone
See the Chai-backbone plugin page
Factory support is added to quickly be able to build backbone models or other objects as you see fit:
#= require factories
You can run the tests by including:
#= require chai-backbone_spec
or you can run the suites seperately:
#= require spec/chai-backbone_spec
#= require spec/chai-changes_spec
#= require spec/factory_spec
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Add a rake task to update dependencies