Skip to content

Testing guidelines

V Brown edited this page Sep 22, 2016 · 2 revisions

Bugfixes

When fixing a bug, write a failing test and make it pass. If the bug is urgent, try to write a test within 24 hours of fixing it.

Specs for new or updated code

  • Each model method should have a test
  • Each controller action should have a test
  • All service object methods should have a test
  • Complex view helpers should have tests
  • Views don't need tests

Behavioral (Cucumber) tests for new or updated code

Each piece of major new functionality should have at least one behavioral test of the main workflow. It doesn't need to cover edge cases or multiple paths through the application.

Testing Javascript

We don't currently have a Javascript testing framework. Cover complex Javascript with browser-based (Cucumber) tests where it's possible.