Remove warnings in ColumnDropper.mark_readonly test.

This commit is contained in:
Guo Xiang Tan 2017-07-25 09:38:55 +09:00
parent be3c9bca0b
commit 4cd9822611

View File

@ -64,6 +64,8 @@ RSpec.describe ColumnDropper do
end
after do
ActiveRecord::Base.connection.reset!
ActiveRecord::Base.exec_sql <<~SQL
DROP TABLE IF EXISTS #{table_name};
DROP TRIGGER IF EXISTS #{table_name}_email_readonly ON #{table_name};
@ -81,8 +83,6 @@ RSpec.describe ColumnDropper do
PG::RaiseException,
/Discourse: email in #{table_name} is readonly/
)
ActiveRecord::Base.exec_sql("ROLLBACK")
end
it 'should allow updates to the other columns' do
@ -107,8 +107,6 @@ RSpec.describe ColumnDropper do
PG::RaiseException,
/Discourse: email in table_with_readonly_column is readonly/
)
ActiveRecord::Base.exec_sql("ROLLBACK")
end
it 'should allow insertions to the other columns' do