1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Use Rack::Lock to prevent concurrency when eager_load is false

This commit is contained in:
Thomas Walpole 2014-09-18 14:38:14 -07:00
parent 304e2fbfe1
commit 385a7507f6

View file

@ -2,6 +2,12 @@ require 'capybara'
require 'capybara/dsl'
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)
end
map "/" do
if Gem::Version.new(Rails.version) >= Gem::Version.new("3.0")
run Rails.application