diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-13 16:20:09 +0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-14 07:46:12 +0200 |
commit | 959f8576f2b70c35a2fd5c2c9563e695977f37b6 (patch) | |
tree | 5bbb4fc14b9ecde391695ad26d9765b7555285d4 /railties/test | |
parent | f07cbec865093c30299ad038d52e3e70e2527848 (diff) | |
download | rails-959f8576f2b70c35a2fd5c2c9563e695977f37b6.tar.gz rails-959f8576f2b70c35a2fd5c2c9563e695977f37b6.tar.bz2 rails-959f8576f2b70c35a2fd5c2c9563e695977f37b6.zip |
Added foo:install:assets task that copies assets from plugins public directory to application's public directory
This is the most simple and naive approach: just copy every files from engine to app.
The only exception is when file has changed, in that case developer will be
asked if he wants to rename the field.
There is no need to make this task more sophisticated as 3.1 will be shipped
with better assets handling and it will be the default way to handle things.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/shared_tests.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 9f48c7acfd..d81155e8af 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -10,6 +10,20 @@ module RailtiesTest @app ||= Rails.application end + def test_copying_assets + @plugin.write "public/javascripts/foo.js", "doSomething()" + @plugin.write "public/stylesheets/foo.css", "h1 { font-size: 10000px }" + @plugin.write "public/images/img.png", "" + + Dir.chdir(app_path) do + `rake bukkits:install:assets --trace` + + assert File.exists?(app_path("public/bukkits/javascripts/foo.js")) + assert File.exists?(app_path("public/bukkits/stylesheets/foo.css")) + assert File.exists?(app_path("public/bukkits/images/img.png")) + end + end + def test_copying_migrations @plugin.write "db/migrate/1_create_users.rb", <<-RUBY class CreateUsers < ActiveRecord::Migration |