Skip to content

Commit 1072c3a

Browse files
committed
Fix test for DDL transactions.
1 parent 711826c commit 1072c3a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/cases/migration_test_sqlserver.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class MigrationTestSqlserver < ActiveRecord::TestCase
1818
end
1919

2020
should 'not create a tables if error in migrations' do
21-
ActiveRecord::Migrator.up(SQLSERVER_MIGRATIONS_ROOT+'/transaction_table')
21+
begin
22+
ActiveRecord::Migrator.up(SQLSERVER_MIGRATIONS_ROOT+'/transaction_table')
23+
rescue Exception => e
24+
assert_match %r|migrations canceled|, e.message
25+
end
2226
assert_does_not_contain @trans_test_table1, @connection.tables
2327
assert_does_not_contain @trans_test_table2, @connection.tables
2428
end

0 commit comments

Comments
 (0)