mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
asakusa.rb hack night!
Fix in-memory tests
This commit is contained in:
parent
4c1c2e6501
commit
79238bad3d
2 changed files with 5 additions and 0 deletions
|
@ -55,6 +55,8 @@ class DefaultScopingTest < ActiveRecord::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_default_scoping_with_threads
|
def test_default_scoping_with_threads
|
||||||
|
skip "in-memory database mustn't disconnect" if in_memory_db?
|
||||||
|
|
||||||
2.times do
|
2.times do
|
||||||
Thread.new {
|
Thread.new {
|
||||||
assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC')
|
assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC')
|
||||||
|
|
|
@ -545,6 +545,9 @@ if current_adapter?(:PostgreSQLAdapter)
|
||||||
# This will cause transactions to overlap and fail unless they are performed on
|
# This will cause transactions to overlap and fail unless they are performed on
|
||||||
# separate database connections.
|
# separate database connections.
|
||||||
def test_transaction_per_thread
|
def test_transaction_per_thread
|
||||||
|
if in_memory_db?
|
||||||
|
skip "in memory db can't share a db between threads"
|
||||||
|
end
|
||||||
threads = 3.times.map do
|
threads = 3.times.map do
|
||||||
Thread.new do
|
Thread.new do
|
||||||
Topic.transaction do
|
Topic.transaction do
|
||||||
|
|
Loading…
Reference in a new issue