1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added test for rake environment in an engine

This commit is contained in:
steve 2011-10-18 17:06:32 +01:00
parent c547e968f5
commit 40d1555091

View file

@ -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