File tree Expand file tree Collapse file tree 2 files changed +13
-16
lines changed
spec/migration_lock_timeout Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 88ACTIVE_RECORD_MIGRATION_CLASS = ActiveRecord ::Migration [ ActiveRecord ::VERSION ::STRING . to_f ]
99
1010def expect_create_table
11- if ActiveRecord . gem_version >= '7.1'
12- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
13- with ( 'BEGIN' ) .
14- and_call_original
15- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
16- with ( /CREATE TABLE/ ) .
17- and_call_original
18- else
19- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
20- with ( 'BEGIN' , 'TRANSACTION' ) .
21- and_call_original
22- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
23- with ( /CREATE TABLE/ ) .
24- and_call_original
25- end
11+ expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
12+ with ( 'BEGIN' , 'TRANSACTION' ) .
13+ and_call_original
14+ expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
15+ with ( /CREATE TABLE/ ) .
16+ and_call_original
2617end
2718
2819RSpec . describe ActiveRecord ::Migration do
Original file line number Diff line number Diff line change 99 password : ENV [ 'POSTGRES_DB_PASSWORD' ] ,
1010 host : 'localhost'
1111 )
12- DatabaseCleaner . strategy = :transaction
12+ DatabaseCleaner . strategy = :truncation
1313 DatabaseCleaner . clean_with ( :truncation )
1414 end
1515
1818 example . run
1919 end
2020 end
21+
22+ if ActiveRecord . gem_version >= '7.1'
23+ config . after ( :each ) do |example |
24+ ActiveRecord ::Base . remove_connection
25+ end
26+ end
2127end
You can’t perform that action at this time.
0 commit comments