File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 171171 expect ( subject . statement_timeout ( '1s' ) { connection . execute ( 'select 1 as value' ) [ 0 ] [ 'value' ] } ) . to eq 1
172172 end
173173
174+ it 'should begin a transaction' do
175+ expect ( subject . statement_timeout ( '1s' ) { |conn | conn . current_transaction . open? } ) . to be true
176+ end
177+
174178 it 'should support transaction' do
175179 expect { subject . statement_timeout ( '1s' ) { subject . transaction { subject . unscoped . take } } }
176180 . to_not raise_error
347351 expect ( subject . statement_timeout ( '1s' ) { connection . execute ( 'select 1 as value' ) [ 0 ] [ 'value' ] } ) . to eq 1
348352 end
349353
354+ it 'should not begin a transaction' do
355+ expect ( subject . statement_timeout ( '1s' ) { |conn | conn . current_transaction . open? } ) . to be false
356+ end
357+
350358 it 'should support transaction' do
351359 expect { subject . statement_timeout ( '1s' ) { subject . transaction { subject . unscoped . take } } }
352360 . to_not raise_error
You can’t perform that action at this time.
0 commit comments