mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-23 05:28:53 +00:00
Updates spec settings to address timeout error
This commit is contained in:
@@ -4,7 +4,7 @@ module DownloadsHelper
|
||||
TIMEOUT = 10
|
||||
|
||||
def self.path
|
||||
Rails.root.join("tmp", "downloads")
|
||||
Rails.root.join("tmp", "capybara")
|
||||
end
|
||||
|
||||
def downloaded_filename
|
||||
@@ -17,16 +17,10 @@ module DownloadsHelper
|
||||
File.read(downloaded_filename)
|
||||
end
|
||||
|
||||
def with_empty_downloads_folder
|
||||
remove_downloaded_files
|
||||
yield
|
||||
remove_downloaded_files
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def downloaded_filenames
|
||||
Dir[DownloadsHelper.path.join("*")]
|
||||
Dir[DownloadsHelper.path.join("*")].select { |f| File.file?(f) }
|
||||
end
|
||||
|
||||
def wait_for_download
|
||||
|
||||
@@ -38,5 +38,6 @@ RSpec.configure do |config|
|
||||
"#{Capybara.current_session.server.host}:#{Capybara.current_session.server.port}"
|
||||
example.run
|
||||
Rails.application.default_url_options[:host] = original_host
|
||||
remove_downloaded_files
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user