In your admin
project, in config/initializers
directory you can create a monkey patch to overwrite the path where the controller spec file is generated:
file /config/initializers/scaffold_generator.rb
require 'generators/rspec/scaffold/scaffold_generator'
module Rspec
module Generators
class ScaffoldGenerator
def generate_controller_spec
return unless options[:controller_specs]
template 'controller_spec.rb',
File.join('/path/to/host/project', 'spec/admin/controllers', controller_class_path, "#{controller_file_name}_controller_spec.rb")
end
end
end
end
It would be clever to replace the hard-coded path '/path/to/host/project' by something more dynamic, so it won't break when you move your workspace files in another location. I can't help you for that because it depends on your project file structure, and it should be easy to do.
To invoke:
bundle exec rails generate scaffold_controller my_controller
Will generate the controller, helper, views, rspec/helper, and rspec/views files in your admin
project, and the rspec/controller file in your host
project