aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorGannon McGibbon <gannon.mcgibbon@gmail.com>2018-09-26 17:16:54 -0400
committerGannon McGibbon <gannon.mcgibbon@gmail.com>2018-09-27 10:35:52 -0400
commit77aaeced89cb84404cf69f8b23834520de3214a9 (patch)
tree7e644c6581425760f859a49bf207e13ed56677a3 /railties/test/generators
parent1930d22936c3bfb883dd4b46173bb902db17bb50 (diff)
downloadrails-77aaeced89cb84404cf69f8b23834520de3214a9.tar.gz
rails-77aaeced89cb84404cf69f8b23834520de3214a9.tar.bz2
rails-77aaeced89cb84404cf69f8b23834520de3214a9.zip
Add migrations_paths option to model generator
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/model_generator_test.rb9
-rw-r--r--railties/test/generators/scaffold_generator_test.rb6
2 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index 7febdfae96..5a0c2f74c7 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -392,6 +392,15 @@ class ModelGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_migrations_paths_puts_migrations_in_that_folder
+ run_generator ["account", "--migrations_paths=db/test_migrate"]
+ assert_migration "db/test_migrate/create_accounts.rb" do |content|
+ assert_method :change, content do |change|
+ assert_match(/create_table :accounts/, change)
+ end
+ end
+ end
+
def test_required_belongs_to_adds_required_association
run_generator ["account", "supplier:references{required}"]
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index e90834bc2b..dbcf49290e 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -476,6 +476,12 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_scaffold_generator_migrations_paths
+ run_generator ["posts", "--migrations-paths=db/kingston_migrate"]
+
+ assert_migration "db/kingston_migrate/create_posts.rb"
+ end
+
def test_scaffold_generator_password_digest
run_generator ["user", "name", "password:digest"]