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

Merge pull request #16914 from untidy-hair/fix_plugin_dummy_path_error

Use dynamic path for dummy app location in plugin's test_helper.rb
This commit is contained in:
Rafael Mendonça França 2014-09-16 10:51:29 -03:00
commit 6e4aa9d5ea
3 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
* Change the path of dummy app location in plugin's test_helper.rb for cases
you specify dummy_path option.
*Yukio Mizuta*
* Fix a bug in the `gem` method for Rails templates when non-String options
are used.

View file

@ -1,7 +1,7 @@
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require File.expand_path("../../<%= options[:dummy_path] -%>/config/environment.rb", __FILE__)
require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!

View file

@ -54,7 +54,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
run_generator
assert_file "README.rdoc", /Bukkits/
assert_no_file "config/routes.rb"
assert_file "test/test_helper.rb"
assert_file "test/test_helper.rb", /require.+test\/dummy\/config\/environment/
assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/
end
@ -270,6 +270,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "spec/dummy"
assert_file "spec/dummy/config/application.rb"
assert_no_file "test/dummy"
assert_file "test/test_helper.rb", /require.+spec\/dummy\/config\/environment/
end
def test_creating_dummy_application_with_different_name
@ -277,6 +278,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "spec/fake"
assert_file "spec/fake/config/application.rb"
assert_no_file "test/dummy"
assert_file "test/test_helper.rb", /require.+spec\/fake\/config\/environment/
end
def test_creating_dummy_without_tests_but_with_dummy_path
@ -284,6 +286,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "spec/dummy"
assert_file "spec/dummy/config/application.rb"
assert_no_file "test"
assert_no_file "test/test_helper.rb"
assert_file '.gitignore' do |contents|
assert_match(/spec\/dummy/, contents)
end