|
8 | 8 | describe 'standard request specs' do
|
9 | 9 | subject { file('spec/requests/posts_request_spec.rb') }
|
10 | 10 |
|
11 |
| - describe 'with --request_specs' do |
| 11 | + describe 'with no options' do |
12 | 12 | before { run_generator %w[posts --request_specs] }
|
13 | 13 | it { is_expected.to exist }
|
14 | 14 | it { is_expected.to contain("require 'rails_helper'") }
|
|
19 | 19 | it { is_expected.to contain(/"redirects to the \w+ list"/) }
|
20 | 20 | end
|
21 | 21 |
|
22 |
| - describe 'with no options' do |
23 |
| - before { run_generator %w[posts] } |
| 22 | + describe 'with --no-request_specs' do |
| 23 | + before { run_generator %w[posts --no-request_specs] } |
24 | 24 | it { is_expected.not_to exist }
|
25 | 25 | end
|
26 | 26 | end
|
27 | 27 |
|
28 | 28 | describe 'standard controller spec' do
|
29 | 29 | subject { file('spec/controllers/posts_controller_spec.rb') }
|
30 | 30 |
|
31 |
| - describe 'with no options' do |
32 |
| - before { run_generator %w[posts] } |
| 31 | + describe 'with --controller_specs' do |
| 32 | + before { run_generator %w[posts --controller_specs] } |
33 | 33 | it { is_expected.to contain(/require 'rails_helper'/) }
|
34 | 34 | it { is_expected.to contain(/^RSpec.describe PostsController, #{type_metatag(:controller)}/) }
|
35 | 35 | it { is_expected.to contain(/GET #new/) }
|
|
47 | 47 | it { is_expected.to contain(/"redirects to the \w+ list"/) }
|
48 | 48 | end
|
49 | 49 |
|
50 |
| - describe 'with --no-controller_specs' do |
51 |
| - before { run_generator %w[posts --no-controller_specs] } |
| 50 | + describe 'with no option' do |
| 51 | + before { run_generator %w[posts] } |
52 | 52 | it { is_expected.not_to exist }
|
53 | 53 | end
|
54 | 54 |
|
55 | 55 | describe 'with --api' do
|
56 |
| - before { run_generator %w[posts --api] } |
| 56 | + before { run_generator %w[posts --controller_specs --api] } |
57 | 57 | it { is_expected.to contain(/require 'rails_helper'/) }
|
58 | 58 | it { is_expected.to contain(/^RSpec.describe PostsController, #{type_metatag(:controller)}/) }
|
59 | 59 | it { is_expected.not_to contain(/GET #new/) }
|
|
81 | 81 |
|
82 | 82 | describe 'namespaced controller spec' do
|
83 | 83 | subject { file('spec/controllers/admin/posts_controller_spec.rb') }
|
84 |
| - before { run_generator %w[admin/posts] } |
| 84 | + before { run_generator %w[admin/posts --controller_specs] } |
85 | 85 | it { is_expected.to contain(/^RSpec.describe Admin::PostsController, #{type_metatag(:controller)}/) }
|
86 | 86 | end
|
87 | 87 |
|
|
0 commit comments