Remove insertion of Rack::Lock middleware in favor of a note in the README due to issue #1419

This commit is contained in:
Thomas Walpole 2014-10-13 10:00:12 -07:00
parent 38389e27e6
commit a4fc9d96f7
2 changed files with 3 additions and 6 deletions

View File

@ -36,6 +36,9 @@ If the application that you are testing is a Rails app, add this line to your te
require 'capybara/rails'
```
Note: In rails 4.0/4.1 The default rails test environment ( config/environments/test.rb ) is not threadsafe - see https://github.com/rails/rails/issues/15089
If you experience random errors about missing constants, adding config.allow_concurrency = false to config/environements/test.rb should solve the issue.
If the application that you are testing is a Rack app, but not Rails, set Capybara.app to your Rack app:
```ruby

View File

@ -2,12 +2,6 @@ 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.allow_concurrency || 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