Commit 9400ff4f authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'rymai-master-patch-46891' into 'master'

Mention "Avoid using `{allow,expect}_any_instance_of`" in testing guide

See merge request gitlab-org/gitlab!31704
parents 74eb48aa 5ba7e951
...@@ -69,6 +69,8 @@ FDOC=1 bin/rspec spec/[path]/[to]/[spec].rb ...@@ -69,6 +69,8 @@ FDOC=1 bin/rspec spec/[path]/[to]/[spec].rb
- Use `Gitlab.config.gitlab.host` rather than hard coding `'localhost'` - Use `Gitlab.config.gitlab.host` rather than hard coding `'localhost'`
- Don't assert against the absolute value of a sequence-generated attribute (see - Don't assert against the absolute value of a sequence-generated attribute (see
[Gotchas](../gotchas.md#do-not-assert-against-the-absolute-value-of-a-sequence-generated-attribute)). [Gotchas](../gotchas.md#do-not-assert-against-the-absolute-value-of-a-sequence-generated-attribute)).
- Avoid using `expect_any_instance_of` or `allow_any_instance_of` (see
[Gotchas](../gotchas.md#do-not-assert-against-the-absolute-value-of-a-sequence-generated-attribute)).
- Don't supply the `:each` argument to hooks since it's the default. - Don't supply the `:each` argument to hooks since it's the default.
- On `before` and `after` hooks, prefer it scoped to `:context` over `:all` - On `before` and `after` hooks, prefer it scoped to `:context` over `:all`
- When using `evaluate_script("$('.js-foo').testSomething()")` (or `execute_script`) which acts on a given element, - When using `evaluate_script("$('.js-foo').testSomething()")` (or `execute_script`) which acts on a given element,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment