|
15 | 15 | describe 'the spec' do
|
16 | 16 | it { is_expected.to exist }
|
17 | 17 | it { is_expected.to contain(/require 'rails_helper'/) }
|
18 |
| - it { is_expected.to contain(/^RSpec.describe 'PostsController', #{type_metatag(:controller)}/) } |
| 18 | + it { is_expected.to contain(/^RSpec.describe PostsController, #{type_metatag(:controller)}/) } |
19 | 19 | end
|
20 | 20 | end
|
21 | 21 | describe 'skipped with a flag' do
|
|
95 | 95 | subject { file('spec/routing/posts_routing_spec.rb') }
|
96 | 96 |
|
97 | 97 | describe 'with no flag' do
|
98 |
| - before { run_generator %w(posts seek and destroy) } |
99 |
| - |
| 98 | + before do |
| 99 | + run_generator %w(posts seek and destroy) |
| 100 | + end |
100 | 101 | it { is_expected.not_to exist }
|
101 | 102 | end
|
102 | 103 |
|
103 | 104 | describe 'with --routing-specs flag' do
|
104 | 105 | describe 'without action parameter' do
|
105 |
| - before { run_generator %w(posts --routing-specs) } |
106 |
| - |
107 |
| - it { is_expected.to contain(/require 'rails_helper'/) } |
108 |
| - it { is_expected.to contain(/^RSpec.describe 'PostsController', #{type_metatag(:routing)}/) } |
109 |
| - it { is_expected.to contain(/describe 'routing'/) } |
| 106 | + before do |
| 107 | + run_generator %w(posts --routing-specs) |
| 108 | + end |
| 109 | + it { is_expected.not_to exist } |
110 | 110 | end
|
111 | 111 |
|
112 | 112 | describe 'with action parameter' do
|
|
115 | 115 | it { is_expected.to contain(/require 'rails_helper'/) }
|
116 | 116 | it { is_expected.to contain(/^RSpec.describe 'PostsController', #{type_metatag(:routing)}/) }
|
117 | 117 | it { is_expected.to contain(/describe 'routing'/) }
|
118 |
| - `` |
119 | 118 | it { is_expected.to contain(/it 'routes to #seek'/) }
|
120 | 119 | it { is_expected.to contain(/expect\(:get => "\/posts\/seek"\).to route_to\("posts#seek"\)/) }
|
121 | 120 | end
|
122 | 121 | end
|
123 | 122 |
|
124 | 123 | describe 'with --no-routing-specs flag' do
|
125 |
| - before { run_generator %w(posts seek and destroy --no-routing_specs) } |
126 |
| - |
| 124 | + before do |
| 125 | + run_generator %w(posts seek and destroy --no-routing_specs) |
| 126 | + end |
127 | 127 | it { is_expected.not_to exist }
|
128 | 128 | end
|
129 | 129 | end
|
|
0 commit comments