aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorYukio Mizuta <untidyhair@gmail.com>2014-09-16 19:42:04 -0700
committerYukio Mizuta <untidyhair@gmail.com>2014-09-16 20:21:17 -0700
commit7137c6b7750ca5d1ddcc794de5e9b219af65de1c (patch)
tree926a199e3ee1d15459ee03bade98baccea452c41 /railties/test
parentde33fe7d7e25945eeafcd8577438aba4721c804e (diff)
downloadrails-7137c6b7750ca5d1ddcc794de5e9b219af65de1c.tar.gz
rails-7137c6b7750ca5d1ddcc794de5e9b219af65de1c.tar.bz2
rails-7137c6b7750ca5d1ddcc794de5e9b219af65de1c.zip
Specify dummy app's db migrate path in plugin's test_helper.rb
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/plugin_generator_test.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index 645efa5daf..ed4e100a9b 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -54,7 +54,10 @@ class PluginGeneratorTest < Rails::Generators::TestCase
run_generator
assert_file "README.rdoc", /Bukkits/
assert_no_file "config/routes.rb"
- assert_file "test/test_helper.rb", /require.+test\/dummy\/config\/environment/
+ assert_file "test/test_helper.rb" do |content|
+ assert_match(/require.+test\/dummy\/config\/environment/, content)
+ assert_match(/ActiveRecord::Migrator\.migrations_paths.+test\/dummy\/db\/migrate/, content)
+ end
assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/
end
@@ -270,7 +273,10 @@ 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/
+ assert_file "test/test_helper.rb" do |content|
+ assert_match(/require.+spec\/dummy\/config\/environment/, content)
+ assert_match(/ActiveRecord::Migrator\.migrations_paths.+spec\/dummy\/db\/migrate/, content)
+ end
end
def test_creating_dummy_application_with_different_name
@@ -278,7 +284,10 @@ 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/
+ assert_file "test/test_helper.rb" do |content|
+ assert_match(/require.+spec\/fake\/config\/environment/, content)
+ assert_match(/ActiveRecord::Migrator\.migrations_paths.+spec\/fake\/db\/migrate/, content)
+ end
end
def test_creating_dummy_without_tests_but_with_dummy_path