Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.52 KB

README.md

File metadata and controls

38 lines (25 loc) · 1.52 KB

Open Build Service Test Suite

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

Running the spec

bundle exec rake spec

Directory structure

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.

Test types

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.

Adding tests

We are using the standard RSpec generators like:

rails generate rspec:model package