File tree 1 file changed +8
-5
lines changed
spec/generators/rspec/scaffold
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Generators are not automatically loaded by Rails
2
2
require 'generators/rspec/scaffold/scaffold_generator'
3
3
require 'support/generators'
4
+ require 'rspec/support/spec/in_sub_process'
4
5
5
6
RSpec . describe Rspec ::Generators ::ScaffoldGenerator , type : :generator do
7
+ include RSpec ::Support ::InSubProcess
6
8
setup_default_destination
7
9
8
10
describe 'standard request specs' do
41
43
end
42
44
43
45
describe 'in an engine' do
44
- before do
45
- allow_any_instance_of ( ::Rails ::Generators ::NamedBase ) . to receive ( :mountable_engine? ) . and_return ( true )
46
- run_generator %w[ posts --request_specs ]
46
+ it do
47
+ in_sub_process do
48
+ allow_any_instance_of ( ::Rails ::Generators ::NamedBase ) . to receive ( :mountable_engine? ) . and_return ( true )
49
+ run_generator %w[ posts --request_specs ]
50
+ is_expected . to contain ( 'Engine.routes.url_helpers' )
51
+ end
47
52
end
48
-
49
- it { is_expected . to contain ( 'Engine.routes.url_helpers' ) }
50
53
end
51
54
end
52
55
You can’t perform that action at this time.
0 commit comments