aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-06 17:29:19 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-06 17:29:19 -0300
commitce1bd47698d63119d8a922620d1ae1c30c9ba2db (patch)
tree4d221dce012e2ef065a479791ca83dfafd438271 /railties
parent1b9ecef3588db922dc1b3dc9da66c13265fbd421 (diff)
parent46599260b1361d1ec54c7cc3188b41200fc272b8 (diff)
downloadrails-ce1bd47698d63119d8a922620d1ae1c30c9ba2db.tar.gz
rails-ce1bd47698d63119d8a922620d1ae1c30c9ba2db.tar.bz2
rails-ce1bd47698d63119d8a922620d1ae1c30c9ba2db.zip
Merge pull request #21043 from y-yagi/loading_fixtures_in_engine_integration_tests
set the correct path to `ActionDispatch::IntegrationTest.fixture_path`
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 6f5a815173..1898691806 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