This is a test suite based on RSpec. We are trying to test things based on the following rules:
- Every method that isn't private must be tested
- Every main workflow has a feature test
bundle exec rake spec
Conventionally, all tests live under the
spec
directory and files matching
spec/**/*_spec.rb
are run by default. Ruby files with custom matchers and macros, etc, belong to
spec/support/
and its subdirectories. Require them in the individual *_spec.rb
or _helper.rb
files.
There are many different types of specs possible in RSpec. We concentrate on 4 types:
- Model specs reside in the
spec/models
directory and test methods in Models. - Controller specs reside in the
spec/controllers
directory and test methods in Controllers. - Helper specs reside in the
spec/helpers
directory and test methods in Helpers. - Feature specs reside in the
spec/features
directory and test workflows through the webui.
We are using the standard RSpec generators like:
rails generate rspec:model package