diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-03-20 13:25:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 13:25:27 -0400 |
commit | 2dfe8f1f84b7c4ff6673e7035adbeecaf31734b0 (patch) | |
tree | c6ffae57858d75097fe62cf4b1e537cf140cab1d /railties/test/generators | |
parent | 30fd30e7ece79c2f4cbd6c0b6cd74471c652423e (diff) | |
parent | a42351acbc5406ab0825befe641144b4cb1ee6bf (diff) | |
download | rails-2dfe8f1f84b7c4ff6673e7035adbeecaf31734b0.tar.gz rails-2dfe8f1f84b7c4ff6673e7035adbeecaf31734b0.tar.bz2 rails-2dfe8f1f84b7c4ff6673e7035adbeecaf31734b0.zip |
Merge pull request #28486 from y-yagi/add_app_update_for_rails_engine
Add `app:update` task to engines
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 8ec096e5c6..afb37b6a99 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -1,6 +1,7 @@ require "generators/generators_test_helper" require "rails/generators/rails/plugin/plugin_generator" require "generators/shared_generator_tests" +require "rails/engine/updater" DEFAULT_PLUGIN_FILES = %w( .gitignore @@ -731,6 +732,21 @@ class PluginGeneratorTest < Rails::Generators::TestCase end end + def test_app_update_generates_bin_file + run_generator [destination_root, "--mountable"] + + Object.const_set("ENGINE_ROOT", destination_root) + FileUtils.rm("#{destination_root}/bin/rails") + + quietly { Rails::Engine::Updater.run(:create_bin_files) } + + assert_file "#{destination_root}/bin/rails" do |content| + assert_match(%r|APP_PATH = File\.expand_path\('\.\./\.\./test/dummy/config/application', __FILE__\)|, content) + end + ensure + Object.send(:remove_const, "ENGINE_ROOT") + end + private def action(*args, &block) |