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

Fix engine command

This commit is contained in:
Yoshiyuki Hirano 2017-08-06 15:07:46 +09:00
parent a8217bb594
commit 02499892a2
2 changed files with 6 additions and 0 deletions

View file

@ -3,7 +3,9 @@
ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/<%= namespaced_name -%>/engine', __dir__)
<% if with_dummy_app? -%>
APP_PATH = File.expand_path('../<%= dummy_path -%>/config/application', __dir__)
<% end -%>
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

View file

@ -101,6 +101,9 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "Rakefile" do |contents|
assert_no_match(/APP_RAKEFILE/, contents)
end
assert_file "bin/rails" do |contents|
assert_no_match(/APP_PATH/, contents)
end
end
def test_generating_adds_dummy_app_in_full_mode_without_sprockets
@ -114,6 +117,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
def test_generating_adds_dummy_app_rake_tasks_without_unit_test_files
run_generator [destination_root, "-T", "--mountable", "--dummy-path", "my_dummy_app"]
assert_file "Rakefile", /APP_RAKEFILE/
assert_file "bin/rails", /APP_PATH/
end
def test_generating_adds_dummy_app_without_javascript_and_assets_deps