summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-05-02 22:30:30 +0000
committerDouwe Maan <douwe@gitlab.com>2017-05-02 22:30:30 +0000
commit2a73f0a638d4268dd367346dd602910f777742f4 (patch)
treef73ca298187d04074b98b6e3c02c2e8a7c23d671 /doc
parent920d55b9f8afd35e16351fb57d671acf66092e89 (diff)
parentd49768296ce596bbbbdf8412c362d9999ce822a4 (diff)
downloadgitlab-ce-2a73f0a638d4268dd367346dd602910f777742f4.tar.gz
Merge branch 'rs-described_class-cop-2' into 'master'
Enable `RSpec/DescribedClass` cop and correct violations See merge request !10930
Diffstat (limited to 'doc')
-rw-r--r--doc/development/testing.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/development/testing.md b/doc/development/testing.md
index 9b0b9808827..6d8b846d27f 100644
--- a/doc/development/testing.md
+++ b/doc/development/testing.md
@@ -188,7 +188,8 @@ Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md).
### General Guidelines
- Use a single, top-level `describe ClassName` block.
-- Use `described_class` instead of repeating the class name being described.
+- Use `described_class` instead of repeating the class name being described
+ (_this is enforced by RuboCop_).
- Use `.method` to describe class methods and `#method` to describe instance
methods.
- Use `context` to test branching logic.
@@ -197,7 +198,7 @@ Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md).
- Don't `describe` symbols (see [Gotchas](gotchas.md#dont-describe-symbols)).
- Don't assert against the absolute value of a sequence-generated attribute (see [Gotchas](gotchas.md#dont-assert-against-the-absolute-value-of-a-sequence-generated-attribute)).
- Don't supply the `:each` argument to hooks since it's the default.
-- Prefer `not_to` to `to_not` (_this is enforced by Rubocop_).
+- Prefer `not_to` to `to_not` (_this is enforced by RuboCop_).
- Try to match the ordering of tests to the ordering within the class.
- Try to follow the [Four-Phase Test][four-phase-test] pattern, using newlines
to separate phases.