diff options
| author | steve <steve@whilefalse.net> | 2011-10-18 17:06:32 +0100 |
|---|---|---|
| committer | steve <steve@whilefalse.net> | 2011-10-18 17:11:50 +0100 |
| commit | 40d1555091433d827e23e92e9f816e11a2db679b (patch) | |
| tree | 71afba02ea489ca3d90d43db9e24332daac1cc4c | |
| parent | c547e968f5709f174ee13818b35429cbe585b5dd (diff) | |
| download | rails-40d1555091433d827e23e92e9f816e11a2db679b.tar.gz rails-40d1555091433d827e23e92e9f816e11a2db679b.tar.bz2 rails-40d1555091433d827e23e92e9f816e11a2db679b.zip | |
Added test for rake environment in an engine
| -rw-r--r-- | railties/test/railties/shared_tests.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 21fde49ff7..7653e52d26 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -21,6 +21,23 @@ module RailtiesTest assert_match "alert()", last_response.body end + def test_rake_environment_can_be_called_in_the_engine_or_plugin + boot_rails + + @plugin.write "Rakefile", <<-RUBY + APP_RAKEFILE = '#{app_path}/Rakefile' + load 'rails/tasks/engine.rake' + task :foo => :environment do + puts "Task ran" + end + RUBY + + Dir.chdir(@plugin.path) do + output = `bundle exec rake foo` + assert_match "Task ran", output + end + end + def test_copying_migrations @plugin.write "db/migrate/1_create_users.rb", <<-RUBY class CreateUsers < ActiveRecord::Migration |
