aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/model_generator_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-12-12 09:55:32 +0000
committerJon Leighton <j@jonathanleighton.com>2010-12-12 09:55:32 +0000
commit9a98c766e045aebc2ef6d5b716936b73407f095d (patch)
tree899834482c828f31a89ebc7bb6e19cbe0b5f18d3 /railties/test/generators/model_generator_test.rb
parent3a7f43ca6ecf1735e1a82d4a68ac8f62b5cf2fcf (diff)
parent307443972c5f6de959a5401eec76ca327484b10c (diff)
downloadrails-9a98c766e045aebc2ef6d5b716936b73407f095d.tar.gz
rails-9a98c766e045aebc2ef6d5b716936b73407f095d.tar.bz2
rails-9a98c766e045aebc2ef6d5b716936b73407f095d.zip
Merge branch 'master' into nested_has_many_through
Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb
Diffstat (limited to 'railties/test/generators/model_generator_test.rb')
-rw-r--r--railties/test/generators/model_generator_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index 8a0f560bc8..552b7eb30a 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -147,10 +147,22 @@ class ModelGeneratorTest < Rails::Generators::TestCase
end
end
- def test_migration_already_exists_error_message
+ def test_migration_is_skipped_with_skip_option
run_generator
- error = capture(:stderr){ run_generator ["Account"], :behavior => :skip }
- assert_match /Another migration is already named create_accounts/, error
+ output = run_generator ["Account", "--skip"]
+ assert_match %r{skip\s+db/migrate/\d+_create_accounts.rb}, output
+ end
+
+ def test_migration_is_ignored_as_identical_with_skip_option
+ run_generator ["Account"]
+ output = run_generator ["Account", "--skip"]
+ assert_match %r{identical\s+db/migrate/\d+_create_accounts.rb}, output
+ end
+
+ def test_migration_is_skipped_on_skip_behavior
+ run_generator
+ output = run_generator ["Account"], :behavior => :skip
+ assert_match %r{skip\s+db/migrate/\d+_create_accounts.rb}, output
end
def test_migration_error_is_not_shown_on_revoke