aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migrator_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/migrator_test.rb')
-rw-r--r--activerecord/test/cases/migrator_test.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb
index 1e16addcf3..0f0384382f 100644
--- a/activerecord/test/cases/migrator_test.rb
+++ b/activerecord/test/cases/migrator_test.rb
@@ -18,6 +18,9 @@ module ActiveRecord
def up; @went_up = true; end
def down; @went_down = true; end
+ # also used in place of a MigrationProxy
+ def filename; "anon.rb"; end
+ def fingerprint; "123456789012345678901234567890ab"; end
end
def setup
@@ -102,7 +105,7 @@ module ActiveRecord
end
def test_finds_pending_migrations
- ActiveRecord::SchemaMigration.create!(:version => '1')
+ ActiveRecord::SchemaMigration.create!(:version => '1', :name => "anon", :migrated_at => Time.now)
migration_list = [ Migration.new('foo', 1), Migration.new('bar', 3) ]
migrations = ActiveRecord::Migrator.new(:up, migration_list).pending_migrations
@@ -152,7 +155,7 @@ module ActiveRecord
end
def test_current_version
- ActiveRecord::SchemaMigration.create!(:version => '1000')
+ ActiveRecord::SchemaMigration.create!(:version => '1000', :name => "anon", :migrated_at => Time.now)
assert_equal 1000, ActiveRecord::Migrator.current_version
end
@@ -320,7 +323,7 @@ module ActiveRecord
def test_only_loads_pending_migrations
# migrate up to 1
- ActiveRecord::SchemaMigration.create!(:version => '1')
+ ActiveRecord::SchemaMigration.create!(:version => '1', :name => "anon", :migrated_at => Time.now)
calls, migrator = migrator_class(3)
migrator.migrate("valid", nil)