Skip to content

Commit 04a7426

Browse files
committed
Merge pull request rails#6690 from suginoy/fix-templates-copy
Fix: 'rake rails:templates:copy' doesn't work
2 parents 2eb4ebe + 358c5e8 commit 04a7426

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

railties/lib/rails/tasks/framework.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace :rails do
2020
project_templates = "#{Rails.root}/lib/templates"
2121

2222
default_templates = { "erb" => %w{controller mailer scaffold},
23-
"rails" => %w{controller helper scaffold_controller stylesheets} }
23+
"rails" => %w{controller helper scaffold_controller assets} }
2424

2525
default_templates.each do |type, names|
2626
local_template_type_dir = File.join(project_templates, type)

railties/test/application/rake_test.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,16 @@ def test_load_activerecord_base_when_we_use_observers
190190
end
191191
end
192192

193+
def test_copy_templates
194+
Dir.chdir(app_path) do
195+
`bundle exec rake rails:templates:copy`
196+
%w(controller mailer scaffold).each do |dir|
197+
assert File.exists?(File.join(app_path, 'lib', 'templates', 'erb', dir))
198+
end
199+
%w(controller helper scaffold_controller assets).each do |dir|
200+
assert File.exists?(File.join(app_path, 'lib', 'templates', 'rails', dir))
201+
end
202+
end
203+
end
193204
end
194205
end

0 commit comments

Comments
 (0)