ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction

I was getting this error in my tests:

ActiveRecord::StatementInvalid:
  PG::InFailedSqlTransaction:
  ERROR:  current transaction is aborted,
  commands ignored until end of transaction block

Here is my Stack Overflow Answer about it.

It was caused by the fact that each test example was wrapped in a database transaction. The solution is to disable wrapping test examples in database transactions for the examples that cause the problem.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s