|
20 | 20 | it { is_expected.to contain('get post_url(post)') }
|
21 | 21 | it { is_expected.to contain('redirect_to(post_url(Post.last))') }
|
22 | 22 | it { is_expected.to contain(/"redirects to the \w+ list"/) }
|
| 23 | + |
| 24 | + if ::Rails::VERSION::STRING >= '7.0.0' |
| 25 | + it { is_expected.to contain(/renders a response with 422 status \(i.e. to display the 'new' template\)/) } |
| 26 | + it { is_expected.to contain(/renders a response with 422 status \(i.e. to display the 'edit' template\)/) } |
| 27 | + else |
| 28 | + it { is_expected.to contain(/renders a successful response \(i.e. to display the 'new' template\)/) } |
| 29 | + it { is_expected.to contain(/renders a successful response \(i.e. to display the 'edit' template\)/) } |
| 30 | + end |
23 | 31 | end
|
24 | 32 |
|
25 | 33 | describe 'with --no-request_specs' do
|
|
62 | 70 | it { is_expected.to contain(/^RSpec.describe PostsController, #{type_metatag(:controller)}/) }
|
63 | 71 | it { is_expected.to contain(/GET #new/) }
|
64 | 72 | it { is_expected.to contain(/"redirects to the created \w+"/) }
|
65 |
| - it { is_expected.to contain(/display the 'new' template/) } |
| 73 | + if ::Rails::VERSION::STRING >= '7.0.0' |
| 74 | + it { is_expected.to contain(/renders a response with 422 status \(i.e. to display the 'new' template\)/) } |
| 75 | + else |
| 76 | + it { is_expected.to contain(/returns a success response \(i.e. to display the 'new' template\)/) } |
| 77 | + end |
66 | 78 | it { is_expected.not_to contain(/"renders a JSON response with the new \w+"/) }
|
67 | 79 | it { is_expected.not_to contain(/"renders a JSON response with errors for the new \w+"/) }
|
68 | 80 |
|
69 | 81 | it { is_expected.to contain(/GET #edit/) }
|
70 | 82 | it { is_expected.to contain(/"redirects to the \w+"/) }
|
71 |
| - it { is_expected.to contain(/display the 'edit' template/) } |
| 83 | + if ::Rails::VERSION::STRING >= '7.0.0' |
| 84 | + it { is_expected.to contain(/renders a response with 422 status \(i.e. to display the 'edit' template\)/) } |
| 85 | + else |
| 86 | + it { is_expected.to contain(/returns a success response \(i.e. to display the 'edit' template\)/) } |
| 87 | + end |
72 | 88 | it { is_expected.not_to contain(/"renders a JSON response with the \w+"/) }
|
73 | 89 | it { is_expected.not_to contain(/"renders a JSON response with errors for the \w+"/) }
|
74 | 90 |
|
|
0 commit comments