mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
We reset the phantom js driver after each context to prevent it memory leaking and dying
This commit is contained in:
@@ -90,6 +90,14 @@ RSpec.configure do |config|
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
def restart_phantomjs
|
||||
Capybara.send('session_pool').values
|
||||
.select { |s| s.driver.is_a?(Capybara::Poltergeist::Driver) }
|
||||
.each { |driver| driver.restart}
|
||||
end
|
||||
|
||||
config.before(:all) { restart_phantomjs }
|
||||
|
||||
# Geocoding
|
||||
config.before(:each) { allow_any_instance_of(Spree::Address).to receive(:geocode).and_return([1,1]) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user