1919| -
2020|===
2121
22- Checks that tests use RSpec `before` hook over Rails `setup` method.
22+ Prefer RSpec `before` hook over Rails `setup` method.
2323
2424[#examples-rspecrailsavoidsetuphook]
2525=== Examples
5555| 2.27
5656|===
5757
58- Checks that tests use `have_http_status` instead of equality matchers.
58+ Prefer `have_http_status` over equality matchers.
5959
6060[#examples-rspecrailshavehttpstatus]
6161=== Examples
6262
63- [#responsemethods_ -__response__-_last_response__ -_default_-rspecrailshavehttpstatus]
64- ==== ResponseMethods: ['response', 'last_response'] (default)
63+ [#_responsemethods_ -__response__-_last_response___ -_default_-rspecrailshavehttpstatus]
64+ ==== ` ResponseMethods: ['response', 'last_response']` (default)
6565
6666[source,ruby]
6767----
@@ -74,8 +74,8 @@ expect(response).to have_http_status(200)
7474expect(last_response).to have_http_status(200)
7575----
7676
77- [#responsemethods_-__foo_response__ -rspecrailshavehttpstatus]
78- ==== ResponseMethods: ['foo_response']
77+ [#_responsemethods_-__foo_response___ -rspecrailshavehttpstatus]
78+ ==== ` ResponseMethods: ['foo_response']`
7979
8080[source,ruby]
8181----
@@ -119,7 +119,7 @@ expect(last_response).to have_http_status(200)
119119| 2.20
120120|===
121121
122- Enforces use of symbolic or numeric value to describe HTTP status.
122+ Enforce use of symbolic or numeric value to describe HTTP status.
123123
124124This cop inspects only `have_http_status` calls.
125125So, this cop does not check if a method starting with `be_*` is used
@@ -224,7 +224,7 @@ it { is_expected.to have_http_status :ok }
224224| -
225225|===
226226
227- Enforces consistency by using the current HTTP status names.
227+ Enforce consistency by using the current HTTP status names.
228228
229229[#examples-rspecrailshttpstatusnameconsistency]
230230=== Examples
@@ -256,7 +256,7 @@ it { is_expected.to have_http_status :unprocessable_content }
256256| -
257257|===
258258
259- Identifies redundant spec type.
259+ Identify redundant spec type.
260260
261261After setting up rspec-rails, you will have enabled
262262`config.infer_spec_type_from_file_location!` by default in
@@ -290,16 +290,11 @@ RSpec.describe User, type: :common do
290290end
291291----
292292
293- [#_inferences_-configuration -rspecrailsinferredspectype]
294- ==== `Inferences` configuration
293+ [#_inferences_-_services_-service__ -rspecrailsinferredspectype]
294+ ==== `Inferences: {services: service}`
295295
296296[source,ruby]
297297----
298- # .rubocop.yml
299- # RSpecRails/InferredSpecType:
300- # Inferences:
301- # services: service
302-
303298# bad
304299# spec/services/user_spec.rb
305300RSpec.describe User, type: :service do
@@ -345,10 +340,10 @@ end
345340| -
346341|===
347342
348- Check if using Minitest-like matchers.
343+ Prefer RSpec/Rails-style matchers over Minitest-like matchers.
349344
350- Check the use of minitest -like matchers
351- starting with `assert_` or `refute_`.
345+ Detect the use of Minitest -like matchers
346+ (those starting with `assert_` or `refute_`) .
352347
353348[#examples-rspecrailsminitestassertions]
354349=== Examples
@@ -396,7 +391,7 @@ expect(response).to have_http_status(:ok)
396391| 2.29
397392|===
398393
399- Enforces use of `be_invalid` or `not_to` for negated be_valid.
394+ Enforce use of `be_invalid` or `not_to` for negated be_valid.
400395
401396[#safety-rspecrailsnegationbevalid]
402397=== Safety
@@ -407,8 +402,8 @@ the test target is an instance of `ActiveModel::Validations``.
407402[#examples-rspecrailsnegationbevalid]
408403=== Examples
409404
410- [#enforcedstyle_-not_to -_default_-rspecrailsnegationbevalid]
411- ==== EnforcedStyle: not_to (default)
405+ [#_enforcedstyle_-not_to_ -_default_-rspecrailsnegationbevalid]
406+ ==== ` EnforcedStyle: not_to` (default)
412407
413408[source,ruby]
414409----
@@ -422,8 +417,8 @@ expect(foo).not_to be_valid
422417expect(foo).to be_invalid.and be_odd
423418----
424419
425- [#enforcedstyle_-be_invalid -rspecrailsnegationbevalid]
426- ==== EnforcedStyle: be_invalid
420+ [#_enforcedstyle_-be_invalid_ -rspecrailsnegationbevalid]
421+ ==== ` EnforcedStyle: be_invalid`
427422
428423[source,ruby]
429424----
0 commit comments