From 11da192d7f8d7542fdcb8c6e586c4edc00563c8d Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Sun, 21 Sep 2014 21:42:31 -0700 Subject: [PATCH] Also check config.allow_concurrency to match Rails 4.2 behavior for Rack::Lock --- History.md | 6 ++++++ lib/capybara/rails.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index e86f5481..4aeef4f8 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,9 @@ +# Version 2.4.3 +Relase date: 2014-09-21 + +###Fixed +* Update concurrency prevention to match Rails 4.2 behavior + # Version 2.4.2 Release date: 2014-09-20 diff --git a/lib/capybara/rails.rb b/lib/capybara/rails.rb index 26bc36e2..c934c388 100644 --- a/lib/capybara/rails.rb +++ b/lib/capybara/rails.rb @@ -5,7 +5,7 @@ Capybara.app = Rack::Builder.new do # Work around an issue where rails allows concurrency in test mode even though eager_load # is false which can cause an issue with constant loading if Gem::Version.new(Rails.version) >= Gem::Version.new("4.0") - use Rack::Lock unless Rails.application.config.eager_load || Rails.application.middleware.include?(Rack::Lock) + use Rack::Lock unless Rails.application.config.allow_concurrency || Rails.application.config.eager_load || Rails.application.middleware.include?(Rack::Lock) end map "/" do