lib/generators/rspec/controller/controller_generator.rb in rspec-rails-6.0.0.rc1 vs lib/generators/rspec/controller/controller_generator.rb in rspec-rails-6.0.0
- old
+ new
@@ -14,18 +14,18 @@
def generate_request_spec
return unless options[:request_specs]
template 'request_spec.rb',
- File.join('spec/requests', class_path, "#{file_name}_spec.rb")
+ target_path('requests', class_path, "#{file_name}_spec.rb")
end
def generate_controller_spec
return unless options[:controller_specs]
template 'controller_spec.rb',
- File.join('spec/controllers', class_path, "#{file_name}_controller_spec.rb")
+ target_path('controllers', class_path, "#{file_name}_controller_spec.rb")
end
def generate_view_specs
return if actions.empty? && behavior == :invoke
return unless options[:view_specs] && options[:template_engine]
@@ -33,19 +33,19 @@
empty_directory File.join("spec", "views", file_path)
actions.each do |action|
@action = action
template 'view_spec.rb',
- File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
+ target_path('views', file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
end
end
def generate_routing_spec
return if actions.empty?
return unless options[:routing_specs]
template 'routing_spec.rb',
- File.join('spec/routing', class_path, "#{file_name}_routing_spec.rb")
+ target_path('routing', class_path, "#{file_name}_routing_spec.rb")
end
end
end
end