diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-13 23:01:46 +0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-14 07:46:12 +0200 |
commit | 43215de208a6feabdbc5f4ec29551beef4f89885 (patch) | |
tree | ba741fae321428bd4258c9f2c7b1819bbf4777f1 /railties/test | |
parent | 959f8576f2b70c35a2fd5c2c9563e695977f37b6 (diff) | |
download | rails-43215de208a6feabdbc5f4ec29551beef4f89885.tar.gz rails-43215de208a6feabdbc5f4ec29551beef4f89885.tar.bz2 rails-43215de208a6feabdbc5f4ec29551beef4f89885.zip |
Add task foo:install (where foo is plugin) as a shortcutinstall:migrations and foo:install:assets
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/shared_tests.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index d81155e8af..31ba2eaca2 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -10,6 +10,28 @@ module RailtiesTest @app ||= Rails.application end + def test_install_migrations_and_assets + @plugin.write "public/javascripts/foo.js", "doSomething()" + + @plugin.write "db/migrate/1_create_users.rb", <<-RUBY + class CreateUsers < ActiveRecord::Migration + end + RUBY + + app_file "db/migrate/1_create_sessions.rb", <<-RUBY + class CreateSessions < ActiveRecord::Migration + end + RUBY + + add_to_config "ActiveRecord::Base.timestamped_migrations = false" + + Dir.chdir(app_path) do + `rake bukkits:install` + assert File.exists?("#{app_path}/db/migrate/2_create_users.rb") + assert File.exists?(app_path("public/bukkits/javascripts/foo.js")) + end + end + def test_copying_assets @plugin.write "public/javascripts/foo.js", "doSomething()" @plugin.write "public/stylesheets/foo.css", "h1 { font-size: 10000px }" @@ -19,7 +41,9 @@ module RailtiesTest `rake bukkits:install:assets --trace` assert File.exists?(app_path("public/bukkits/javascripts/foo.js")) + assert_equal "doSomething()\n", File.read(app_path("public/bukkits/javascripts/foo.js")) assert File.exists?(app_path("public/bukkits/stylesheets/foo.css")) + assert_equal "h1 { font-size: 10000px }\n", File.read(app_path("public/bukkits/stylesheets/foo.css")) assert File.exists?(app_path("public/bukkits/images/img.png")) end end |