aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/schema_dumper_test.rb
diff options
context:
space:
mode:
authorJosh Susser <josh@hasmanythrough.com>2010-03-20 18:26:12 -0700
committerJosh Susser <josh@hasmanythrough.com>2010-12-01 10:57:38 -0800
commit7139aa878ceea8dd17a60955cd4d07f5f68980d9 (patch)
tree6246048e1a611d770a3f5b5b0208c6597cbd646a /activerecord/test/cases/schema_dumper_test.rb
parent4e4e9ad48a222ac94a904c62ae684c609bd8e177 (diff)
downloadrails-7139aa878ceea8dd17a60955cd4d07f5f68980d9.tar.gz
rails-7139aa878ceea8dd17a60955cd4d07f5f68980d9.tar.bz2
rails-7139aa878ceea8dd17a60955cd4d07f5f68980d9.zip
name in schema_migrations, migrations in schema dump
Diffstat (limited to 'activerecord/test/cases/schema_dumper_test.rb')
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index 9b2c7c00df..fdcf1b5cd4 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -17,6 +17,21 @@ class SchemaDumperTest < ActiveRecord::TestCase
assert_no_match %r{create_table "schema_migrations"}, output
end
+ def test_schema_dump_includes_migrations
+ conn = ActiveRecord::Base.connection
+ sm_table = ActiveRecord::Migrator.schema_migrations_table_name
+ conn.execute "DELETE FROM #{conn.quote_table_name(sm_table)}"
+ conn.remove_column "people", "last_name" rescue nil
+ conn.drop_table "reminders" rescue nil
+ conn.drop_table "people_reminders" rescue nil
+ ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
+
+ output = standard_dump
+ assert_match %r{migration "1", "people_have_last_names"}, output
+ assert_match %r{migration "2", "we_need_reminders"}, output
+ assert_match %r{migration "3", "innocent_jointable"}, output
+ end
+
def test_schema_dump_excludes_sqlite_sequence
output = standard_dump
assert_no_match %r{create_table "sqlite_sequence"}, output