Sha256: b4c9575c3318fa59a1765f1e5f3352aaf6f0f50bc74143bda3a0abf001a6ff30
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'abstract_unit' if ActiveRecord::Base.connection.supports_migrations? class Thing < ActiveRecord::Base attr_accessor :version acts_as_versioned end class MigrationTest < Test::Unit::TestCase def teardown ActiveRecord::Base.connection.initialize_schema_information ActiveRecord::Base.connection.update "UPDATE schema_info SET version = 0" Thing.connection.drop_table "things" rescue nil Thing.connection.drop_table "thing_versions" rescue nil Thing.reset_column_information end def test_versioned_migration assert_raises(ActiveRecord::StatementInvalid) { Thing.create :title => 'blah blah' } # take 'er up ActiveRecord::Migrator.up(File.dirname(__FILE__) + '/fixtures/migrations/') t = Thing.create :title => 'blah blah' assert_equal 1, t.versions.size # now lets take 'er back down ActiveRecord::Migrator.down(File.dirname(__FILE__) + '/fixtures/migrations/') assert_raises(ActiveRecord::StatementInvalid) { Thing.create :title => 'blah blah' } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_versioned-0.2 | test/migration_test.rb |
acts_as_versioned-0.2.1 | test/migration_test.rb |