diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-27 19:27:40 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-27 19:27:40 -0300 |
commit | be4b3df8bbd6a0ca8401e85103f3b8ffeed8ea70 (patch) | |
tree | 55d382271be6179eb1cec5c46a3c2b2011c20174 /railties/test | |
parent | d0a99c8b263a5d58203871a12611bb5e969313cd (diff) | |
parent | 50de394cc863acac9400e955cb93ed81b45e9eac (diff) | |
download | rails-be4b3df8bbd6a0ca8401e85103f3b8ffeed8ea70.tar.gz rails-be4b3df8bbd6a0ca8401e85103f3b8ffeed8ea70.tar.bz2 rails-be4b3df8bbd6a0ca8401e85103f3b8ffeed8ea70.zip |
Merge pull request #15269 from arunagw/aa-fixes-8930
rake railties:install:migrations respects the order of railties
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 6240dc04ec..ec64ce5941 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -112,6 +112,38 @@ module RailtiesTest end end + test 'respects the order of railties when installing migrations' do + @blog = engine "blog" do |plugin| + plugin.write "lib/blog.rb", <<-RUBY + module Blog + class Engine < ::Rails::Engine + end + end + RUBY + end + + @plugin.write "db/migrate/1_create_users.rb", <<-RUBY + class CreateUsers < ActiveRecord::Migration + end + RUBY + + @blog.write "db/migrate/2_create_blogs.rb", <<-RUBY + class CreateBlogs < ActiveRecord::Migration + end + RUBY + + add_to_config("config.railties_order = [Bukkits::Engine, Blog::Engine, :all, :main_app]") + + boot_rails + + Dir.chdir(app_path) do + output = `bundle exec rake railties:install:migrations`.split("\n") + + assert_match(/Copied migration \d+_create_users.bukkits.rb from bukkits/, output.first) + assert_match(/Copied migration \d+_create_blogs.blog_engine.rb from blog_engine/, output.last) + end + end + test "mountable engine should copy migrations within engine_path" do @plugin.write "lib/bukkits.rb", <<-RUBY module Bukkits |