Skip to content

Commit f0f0cc0

Browse files
committed
itest
1 parent 3af1cf8 commit f0f0cc0

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

spec/spec_helper.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@
3232
}
3333
}
3434

35+
puts "Testing with #{ActiveRecord::Base.configurations}"
36+
3537
# Configure ActiveRecord
3638
ActiveRecord::Migration.verbose = false
3739
ActiveRecord::Base.table_name_prefix = ENV['DB_PREFIX'].to_s
3840
ActiveRecord::Base.table_name_suffix = ENV['DB_SUFFIX'].to_s
3941
ActiveRecord::Base.establish_connection
4042

4143
def env_db
42-
@env_db ||= if ActiveRecord::Base.respond_to?(:connection_db_config)
43-
ActiveRecord::Base.connection_db_config.adapter
44-
else
45-
ActiveRecord::Base.connection_config[:adapter]
46-
end.to_sym
44+
@env_db ||= ActiveRecord::Base.connection_db_config.adapter.to_sym
4745
end
4846

4947
# Use in specs to skip some tests

test/closure_tree/model_test.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
end
99
end
1010

11-
describe "multi database support" do
11+
describe 'multi database support' do
1212
it 'should have a different connection for menu items' do
1313
# These 2 models are in the same database
1414
assert_equal Tag.connection, Metal.connection
@@ -20,5 +20,4 @@
2020
# The hierarchy table is in the same database
2121
assert_equal MenuItem.connection, MenuItemHierarchy.connection
2222
end
23-
24-
end
23+
end

test/test_helper.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
}
2020
}
2121

22+
puts "Testing with #{ActiveRecord::Base.configurations}"
23+
2224
ENV['WITH_ADVISORY_LOCK_PREFIX'] ||= SecureRandom.hex
2325

24-
ActiveRecord::Base.establish_connection
2526

2627
def env_db
2728
@env_db ||= ActiveRecord::Base.connection_db_config.adapter.to_sym

0 commit comments

Comments
 (0)