Commit 64f85888 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'docs-update-expect_next_instance_of' into 'master'

Make docs about expect_next_instance_of consistent

See merge request gitlab-org/gitlab-ce!23507
parents 83f0798e b8a6d57b
......@@ -92,7 +92,7 @@ describe API::Labels do
end
```
## Avoid using `allow_any_instance_of` in RSpec
## Avoid using `expect_any_instance_of` or `allow_any_instance_of` in RSpec
### Why
......@@ -102,7 +102,7 @@ end
error like this:
```
1.1) Failure/Error: allow_any_instance_of(ApplicationSetting).to receive_messages(messages)
1.1) Failure/Error: expect_any_instance_of(ApplicationSetting).to receive_messages(messages)
Using `any_instance` to stub a method (elasticsearch_indexing) that has been defined on a prepended module (EE::ApplicationSetting) is not supported.
```
......@@ -112,7 +112,7 @@ Instead of writing:
```ruby
# Don't do this:
allow_any_instance_of(Project).to receive(:add_import_job)
expect_any_instance_of(Project).to receive(:add_import_job)
```
We could write:
......
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