aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-07-27 20:34:10 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-07-28 08:05:53 +0900
commit46599260b1361d1ec54c7cc3188b41200fc272b8 (patch)
tree24d52d214c5314942f5c3bd6aaf5aa215a3b2c1f /railties
parent119b9181ece399c67213543fb5227b82688b536f (diff)
downloadrails-46599260b1361d1ec54c7cc3188b41200fc272b8.tar.gz
rails-46599260b1361d1ec54c7cc3188b41200fc272b8.tar.bz2
rails-46599260b1361d1ec54c7cc3188b41200fc272b8.zip
set the correct path to `ActionDispatch::IntegrationTest.fixture_path`
`ActionDispatch::IntegrationTest.fixture_path` set by `test_help.rb`, but if the engine, path under the dummy is will be set, fixtures under test was not loaded.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb1
-rw-r--r--railties/test/generators/plugin_generator_test.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
index 95adcc06ff..b1b77629d4 100644
--- a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
@@ -20,6 +20,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
# Load fixtures from the engine
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
ActiveSupport::TestCase.fixtures :all
end
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index 73e68863f4..d66b28117d 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -313,6 +313,7 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "test/test_helper.rb" do |content|
assert_match(/ActiveRecord::Migrator\.migrations_paths.+\.\.\/test\/dummy\/db\/migrate/, content)
assert_match(/ActiveRecord::Migrator\.migrations_paths.+<<.+\.\.\/db\/migrate/, content)
+ assert_match(/ActionDispatch::IntegrationTest\.fixture_path = ActiveSupport::TestCase\.fixture_pat/, content)
end
end