From 7cb71089d7509379b8426b3a5dbfaf77373f0114 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Mon, 27 Jun 2022 17:57:53 +0100 Subject: [PATCH] Testing --- docs/testing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/testing.md b/docs/testing.md index 6818a21e3..64cbdb160 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -4,3 +4,5 @@ - Capybara is used for our feature tests. These use the Rack driver by default (faster) or the Gecko driver (installation required) when the `js: true` option is passed for a test. - Capybara is configured to run in headless mode but this can be toggled by commenting out `app/spec/rails_helper.rb#L14` - Capybara is configured to use Gecko driver for JS tests as Chrome is more commonly used and so naturally more likely to be better tested but this can be switched to Chrome driver by changing `app/spec/rails_helper.rb#L13` +- Feature specs are generally written sparingly as they're also the slowest, where possible a request spec is preferred as this still tests a large surface area (route, controller, model, view) without the performance impact. They are not suitable for tests that need to run javascript or test that a specific set of UI events triggers a specific set of requests (with high confidence). +- Test data is created with [FactoryBot](https://github.com/thoughtbot/factory_bot) where ever possible