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:
parent
304e2fbfe1
commit
385a7507f6
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue