diff --git a/test/transaction_test.rb b/test/transaction_test.rb index e0e224f..0cc7092 100644 --- a/test/transaction_test.rb +++ b/test/transaction_test.rb @@ -69,5 +69,13 @@ def pg_lock_count end assert_equal(0, pg_lock_count) end + + specify 'transaction level locks fail if not in transaction' do + Tag.with_advisory_lock 'test', transaction: true do + raise 'should not get here' + end + + assert_match(/#{Regexp.escape('requires transaction')}/, exception.message) + end end end