@@ -9,6 +9,7 @@ detailed explanations of how the application is supposed to behave,
9
9
expressed in plain English.
10
10
11
11
According to [ RSpec Rails new versioning strategy] [ ] use:
12
+ * ** [ ` rspec-rails ` 8.x] [ ] ** for Rails 8.0 or 7.2.
12
13
* ** [ ` rspec-rails ` 7.x] [ ] ** for Rails 7.x.
13
14
* ** [ ` rspec-rails ` 6.x] [ ] ** for Rails 6.1, 7.0 or 7.1.
14
15
* ** [ ` rspec-rails ` 5.x] [ ] ** for Rails 5.2 or 6.x.
@@ -28,20 +29,21 @@ According to [RSpec Rails new versioning strategy][] use:
28
29
[ `rspec-rails` 5.x ] : https://github.com/rspec/rspec-rails/tree/5-1-maintenance
29
30
[ `rspec-rails` 6.x ] : https://github.com/rspec/rspec-rails/tree/6-1-maintenance
30
31
[ `rspec-rails` 7.x ] : https://github.com/rspec/rspec-rails/tree/7-1-maintenance
32
+ [ `rspec-rails` 8.x ] : https://github.com/rspec/rspec-rails/tree/8-0-maintenance
31
33
[ RSpec Rails new versioning strategy ] : https://github.com/rspec/rspec-rails/blob/main/rfcs/versioning-strategy.md
32
34
33
35
## Installation
34
36
35
37
** IMPORTANT** This README / branch refers to the current development build.
36
- See the [ ` 7-1 -maintenance` branch on Github] ( https://github.com/rspec/rspec-rails/tree/7-1 -maintenance ) if you want or require the latest stable release.
38
+ See the [ ` 8-0 -maintenance` branch on Github] ( https://github.com/rspec/rspec-rails/tree/8-0 -maintenance ) if you want or require the latest stable release.
37
39
38
40
1 . Add ` rspec-rails ` to ** both** the ` :development ` and ` :test ` groups
39
41
of your app’s ` Gemfile ` :
40
42
41
43
``` ruby
42
44
# Run against this stable release
43
45
group :development , :test do
44
- gem ' rspec-rails' , ' ~> 7 .0.0'
46
+ gem ' rspec-rails' , ' ~> 8 .0.0'
45
47
end
46
48
47
49
# Or, run against the main branch
@@ -85,7 +87,7 @@ read the [`rspec-rails` upgrade notes][] to find out what to watch out for.
85
87
86
88
Be sure to check the general [ RSpec upgrade notes] [ ] as well.
87
89
88
- [ `rspec-rails` upgrade notes ] : https://rspec.info/features/7-1 /rspec-rails/upgrade
90
+ [ `rspec-rails` upgrade notes ] : https://rspec.info/features/8-0 /rspec-rails/upgrade
89
91
[ RSpec upgrade notes ] : https://rspec.info/upgrading-from-rspec-2/
90
92
91
93
## Usage
@@ -207,22 +209,22 @@ to test the various parts of a Rails system:
207
209
Follow the links above for examples of how each matcher is used.
208
210
209
211
[ the matchers that come standard in RSpec ] : https://rspec.info/features/3-12/rspec-expectations/built-in-matchers
210
- [ `be_a_new` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/new-record-matcher
211
- [ `render_template` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/render-template-matcher
212
- [ `redirect_to` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/redirect-to-matcher
213
- [ `route_to` ] : https://rspec.info/features/7-1 /rspec-rails/routing-specs/route-to-matcher
214
- [ `be_routable` ] : https://rspec.info/features/7-1 /rspec-rails/routing-specs/be-routable-matcher
215
- [ `have_http_status` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/have-http-status-matcher
216
- [ `match_array` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/relation-match-array
217
- [ `have_been_enqueued` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/have-been-enqueued-matcher
218
- [ `have_enqueued_job` ] : https://rspec.info/features/7-1 /rspec-rails/matchers/have-enqueued-job-matcher
212
+ [ `be_a_new` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/new-record-matcher
213
+ [ `render_template` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/render-template-matcher
214
+ [ `redirect_to` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/redirect-to-matcher
215
+ [ `route_to` ] : https://rspec.info/features/8-0 /rspec-rails/routing-specs/route-to-matcher
216
+ [ `be_routable` ] : https://rspec.info/features/8-0 /rspec-rails/routing-specs/be-routable-matcher
217
+ [ `have_http_status` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/have-http-status-matcher
218
+ [ `match_array` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/relation-match-array
219
+ [ `have_been_enqueued` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/have-been-enqueued-matcher
220
+ [ `have_enqueued_job` ] : https://rspec.info/features/8-0 /rspec-rails/matchers/have-enqueued-job-matcher
219
221
220
222
### What else does RSpec Rails add?
221
223
222
224
For a comprehensive look at RSpec Rails’ features,
223
225
read the [ official Cucumber documentation] [ ] .
224
226
225
- [ official Cucumber documentation ] : https://rspec.info/features/7-1 /rspec-rails
227
+ [ official Cucumber documentation ] : https://rspec.info/features/8-0 /rspec-rails
226
228
227
229
## What tests should I write?
228
230
@@ -267,20 +269,20 @@ RSpec.describe User, type: :model do
267
269
...
268
270
```
269
271
270
- [ request ] : https://rspec.info/features/7-1 /rspec-rails/request-specs/request-spec
271
- [ feature ] : https://rspec.info/features/7-1 /rspec-rails/feature-specs/feature-spec
272
- [ system ] : https://rspec.info/features/7-1 /rspec-rails/system-specs/system-specs
273
- [ model ] : https://rspec.info/features/7-1 /rspec-rails/model-specs
274
- [ controller ] : https://rspec.info/features/7-1 /rspec-rails/controller-specs
275
- [ mailer ] : https://rspec.info/features/7-1 /rspec-rails/mailer-specs
276
- [ job ] : https://rspec.info/features/7-1 /rspec-rails/job-specs/job-spec
277
- [ view ] : https://rspec.info/features/7-1 /rspec-rails/view-specs/view-spec
278
- [ routing ] : https://rspec.info/features/7-1 /rspec-rails/routing-specs
279
- [ helper ] : https://rspec.info/features/7-1 /rspec-rails/helper-specs/helper-spec
272
+ [ request ] : https://rspec.info/features/8-0 /rspec-rails/request-specs/request-spec
273
+ [ feature ] : https://rspec.info/features/8-0 /rspec-rails/feature-specs/feature-spec
274
+ [ system ] : https://rspec.info/features/8-0 /rspec-rails/system-specs/system-specs
275
+ [ model ] : https://rspec.info/features/8-0 /rspec-rails/model-specs
276
+ [ controller ] : https://rspec.info/features/8-0 /rspec-rails/controller-specs
277
+ [ mailer ] : https://rspec.info/features/8-0 /rspec-rails/mailer-specs
278
+ [ job ] : https://rspec.info/features/8-0 /rspec-rails/job-specs/job-spec
279
+ [ view ] : https://rspec.info/features/8-0 /rspec-rails/view-specs/view-spec
280
+ [ routing ] : https://rspec.info/features/8-0 /rspec-rails/routing-specs
281
+ [ helper ] : https://rspec.info/features/8-0 /rspec-rails/helper-specs/helper-spec
280
282
[ `ActionDispatch::IntegrationTest` ] : https://api.rubyonrails.org/classes/ActionDispatch/IntegrationTest.html
281
283
[ `ActionDispatch::SystemTestCase` ] : https://api.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
282
284
[ `ActionController::TestCase` ] : https://api.rubyonrails.org/classes/ActionController/TestCase.html
283
- [ in the appropriate folder ] : https://rspec.info/features/7-1 /rspec-rails/directory-structure
285
+ [ in the appropriate folder ] : https://rspec.info/features/8-0 /rspec-rails/directory-structure
284
286
285
287
### System specs, feature specs, request specs–what’s the difference?
286
288
0 commit comments