diff --git a/Gemfile b/Gemfile index c49bfd14..90d804a9 100644 --- a/Gemfile +++ b/Gemfile @@ -86,6 +86,7 @@ group :test do # webkit and poltergeist don't seem to work yet gem 'selenium-webdriver' gem 'database_cleaner' + gem 'connection_pool' # need to include rspec components before i18n-spec or rake fails in test environment gem 'rspec-core' gem 'rspec-expectations' diff --git a/Gemfile.lock b/Gemfile.lock index f4dadb98..052ef358 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,6 +114,7 @@ GEM execjs coffee-script-source (1.6.3) commonjs (0.2.7) + connection_pool (1.2.0) content_for_in_controllers (0.0.2) coveralls (0.7.0) multi_json (~> 1.3) @@ -387,6 +388,7 @@ DEPENDENCIES client_side_validations client_side_validations-simple_form coffee-rails (~> 3.2.1) + connection_pool coveralls daemons database_cleaner diff --git a/spec/support/shared_database.rb b/spec/support/shared_database.rb index 55f8f2b3..5441c78d 100644 --- a/spec/support/shared_database.rb +++ b/spec/support/shared_database.rb @@ -5,7 +5,7 @@ class ActiveRecord::Base @@shared_connection = nil def self.connection - @@shared_connection || retrieve_connection + @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } end end # Forces all threads to share the same connection. This works on