Permalink
Browse files

Merge pull request #6690 from suginoy/fix-templates-copy

Fix: 'rake rails:templates:copy' doesn't work
  • Loading branch information...
2 parents 2eb4ebe + 358c5e8 commit 04a7426a2e2567a0e2101c98711393fdfc40160e @rafaelfranca rafaelfranca committed Jun 11, 2012
Showing with 12 additions and 1 deletion.
  1. +1 −1 railties/lib/rails/tasks/framework.rake
  2. +11 −0 railties/test/application/rake_test.rb
@@ -20,7 +20,7 @@ namespace :rails do
project_templates = "#{Rails.root}/lib/templates"
default_templates = { "erb" => %w{controller mailer scaffold},
- "rails" => %w{controller helper scaffold_controller stylesheets} }
+ "rails" => %w{controller helper scaffold_controller assets} }
default_templates.each do |type, names|
local_template_type_dir = File.join(project_templates, type)
@@ -190,5 +190,16 @@ def test_load_activerecord_base_when_we_use_observers
end
end
+ def test_copy_templates
+ Dir.chdir(app_path) do
+ `bundle exec rake rails:templates:copy`
+ %w(controller mailer scaffold).each do |dir|
+ assert File.exists?(File.join(app_path, 'lib', 'templates', 'erb', dir))
+ end
+ %w(controller helper scaffold_controller assets).each do |dir|
+ assert File.exists?(File.join(app_path, 'lib', 'templates', 'rails', dir))
+ end
+ end
+ end
end
end

0 comments on commit 04a7426

Please sign in to comment.