Skip to content

Commit fcf70fa

Browse files
authored
Merge pull request #53 from rubocop/add-anchors
Add anchors
2 parents 71d49a0 + 7a4f9a6 commit fcf70fa

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/modules/ROOT/pages/cops_rspecrails.adoc

+36
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
= RSpecRails
88
9+
[#rspecrailsavoidsetuphook]
910
== RSpecRails/AvoidSetupHook
1011
1112
|===
@@ -20,6 +21,7 @@
2021
2122
Checks that tests use RSpec `before` hook over Rails `setup` method.
2223
24+
[#examples-rspecrailsavoidsetuphook]
2325
=== Examples
2426
2527
[source,ruby]
@@ -35,10 +37,12 @@ before do
3537
end
3638
----
3739
40+
[#references-rspecrailsavoidsetuphook]
3841
=== References
3942
4043
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/AvoidSetupHook
4144
45+
[#rspecrailshavehttpstatus]
4246
== RSpecRails/HaveHttpStatus
4347
4448
|===
@@ -53,8 +57,10 @@ end
5357
5458
Checks that tests use `have_http_status` instead of equality matchers.
5559
60+
[#examples-rspecrailshavehttpstatus]
5661
=== Examples
5762
63+
[#responsemethods_-__response__-_last_response__-_default_-rspecrailshavehttpstatus]
5864
==== ResponseMethods: ['response', 'last_response'] (default)
5965
6066
[source,ruby]
@@ -68,6 +74,7 @@ expect(response).to have_http_status(200)
6874
expect(last_response).to have_http_status(200)
6975
----
7076
77+
[#responsemethods_-__foo_response__-rspecrailshavehttpstatus]
7178
==== ResponseMethods: ['foo_response']
7279
7380
[source,ruby]
@@ -83,6 +90,7 @@ expect(response).to have_http_status(200)
8390
expect(last_response).to have_http_status(200)
8491
----
8592
93+
[#configurable-attributes-rspecrailshavehttpstatus]
8694
=== Configurable attributes
8795
8896
|===
@@ -93,10 +101,12 @@ expect(last_response).to have_http_status(200)
93101
| Array
94102
|===
95103
104+
[#references-rspecrailshavehttpstatus]
96105
=== References
97106
98107
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/HaveHttpStatus
99108
109+
[#rspecrailshttpstatus]
100110
== RSpecRails/HttpStatus
101111
102112
|===
@@ -117,8 +127,10 @@ when setting for `EnforcedStyle: symbolic` or
117127
`EnforcedStyle: numeric`.
118128
This cop is also capable of detecting unknown HTTP status codes.
119129
130+
[#examples-rspecrailshttpstatus]
120131
=== Examples
121132
133+
[#_enforcedstyle_-symbolic_-_default_-rspecrailshttpstatus]
122134
==== `EnforcedStyle: symbolic` (default)
123135
124136
[source,ruby]
@@ -136,6 +148,7 @@ it { is_expected.to have_http_status :success }
136148
it { is_expected.to have_http_status :error }
137149
----
138150
151+
[#_enforcedstyle_-numeric_-rspecrailshttpstatus]
139152
==== `EnforcedStyle: numeric`
140153
141154
[source,ruby]
@@ -153,6 +166,7 @@ it { is_expected.to have_http_status :success }
153166
it { is_expected.to have_http_status :error }
154167
----
155168
169+
[#_enforcedstyle_-be_status_-rspecrailshttpstatus]
156170
==== `EnforcedStyle: be_status`
157171
158172
[source,ruby]
@@ -181,6 +195,7 @@ it { is_expected.to have_http_status :oki_doki }
181195
it { is_expected.to have_http_status :ok }
182196
----
183197
198+
[#configurable-attributes-rspecrailshttpstatus]
184199
=== Configurable attributes
185200
186201
|===
@@ -191,10 +206,12 @@ it { is_expected.to have_http_status :ok }
191206
| `numeric`, `symbolic`, `be_status`
192207
|===
193208
209+
[#references-rspecrailshttpstatus]
194210
=== References
195211
196212
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/HttpStatus
197213
214+
[#rspecrailsinferredspectype]
198215
== RSpecRails/InferredSpecType
199216
200217
|===
@@ -214,11 +231,13 @@ After setting up rspec-rails, you will have enabled
214231
spec/rails_helper.rb. This cop works in conjunction with this config.
215232
If you disable this config, disable this cop as well.
216233
234+
[#safety-rspecrailsinferredspectype]
217235
=== Safety
218236
219237
This cop is marked as unsafe because
220238
`config.infer_spec_type_from_file_location!` may not be enabled.
221239
240+
[#examples-rspecrailsinferredspectype]
222241
=== Examples
223242
224243
[source,ruby]
@@ -239,6 +258,7 @@ RSpec.describe User, type: :common do
239258
end
240259
----
241260
261+
[#_inferences_-configuration-rspecrailsinferredspectype]
242262
==== `Inferences` configuration
243263
244264
[source,ruby]
@@ -264,6 +284,7 @@ RSpec.describe User, type: :common do
264284
end
265285
----
266286
287+
[#configurable-attributes-rspecrailsinferredspectype]
267288
=== Configurable attributes
268289
269290
|===
@@ -274,10 +295,12 @@ end
274295
|
275296
|===
276297
298+
[#references-rspecrailsinferredspectype]
277299
=== References
278300
279301
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/InferredSpecType
280302
303+
[#rspecrailsminitestassertions]
281304
== RSpecRails/MinitestAssertions
282305
283306
|===
@@ -295,6 +318,7 @@ Check if using Minitest-like matchers.
295318
Check the use of minitest-like matchers
296319
starting with `assert_` or `refute_`.
297320
321+
[#examples-rspecrailsminitestassertions]
298322
=== Examples
299323
300324
[source,ruby]
@@ -320,10 +344,12 @@ expect(a).to be(true)
320344
expect(a).to be(false)
321345
----
322346
347+
[#references-rspecrailsminitestassertions]
323348
=== References
324349
325350
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/MinitestAssertions
326351
352+
[#rspecrailsnegationbevalid]
327353
== RSpecRails/NegationBeValid
328354
329355
|===
@@ -338,13 +364,16 @@ expect(a).to be(false)
338364
339365
Enforces use of `be_invalid` or `not_to` for negated be_valid.
340366
367+
[#safety-rspecrailsnegationbevalid]
341368
=== Safety
342369
343370
This cop is unsafe because it cannot guarantee that
344371
the test target is an instance of `ActiveModel::Validations``.
345372
373+
[#examples-rspecrailsnegationbevalid]
346374
=== Examples
347375
376+
[#enforcedstyle_-not_to-_default_-rspecrailsnegationbevalid]
348377
==== EnforcedStyle: not_to (default)
349378
350379
[source,ruby]
@@ -359,6 +388,7 @@ expect(foo).not_to be_valid
359388
expect(foo).to be_invalid.and be_odd
360389
----
361390
391+
[#enforcedstyle_-be_invalid-rspecrailsnegationbevalid]
362392
==== EnforcedStyle: be_invalid
363393
364394
[source,ruby]
@@ -373,6 +403,7 @@ expect(foo).to be_invalid
373403
expect(foo).to be_invalid.or be_even
374404
----
375405
406+
[#configurable-attributes-rspecrailsnegationbevalid]
376407
=== Configurable attributes
377408
378409
|===
@@ -383,10 +414,12 @@ expect(foo).to be_invalid.or be_even
383414
| `not_to`, `be_invalid`
384415
|===
385416
417+
[#references-rspecrailsnegationbevalid]
386418
=== References
387419
388420
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/NegationBeValid
389421
422+
[#rspecrailstravelaround]
390423
== RSpecRails/TravelAround
391424
392425
|===
@@ -401,6 +434,7 @@ expect(foo).to be_invalid.or be_even
401434
402435
Prefer to travel in `before` rather than `around`.
403436
437+
[#safety-rspecrailstravelaround]
404438
=== Safety
405439
406440
This cop is unsafe because the automatic `travel_back` is only run
@@ -410,6 +444,7 @@ And also, this cop's autocorrection is unsafe because the order of
410444
execution will change if other steps exist before traveling in
411445
`around`.
412446
447+
[#examples-rspecrailstravelaround]
413448
=== Examples
414449
415450
[source,ruby]
@@ -425,6 +460,7 @@ end
425460
before { freeze_time }
426461
----
427462
463+
[#references-rspecrailstravelaround]
428464
=== References
429465
430466
* https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/TravelAround

0 commit comments

Comments
 (0)