Updates spec settings to address timeout error

This commit is contained in:
filipefurtad0
2022-06-16 15:15:01 +01:00
parent 54bcd75f3f
commit b0d29c6dbc
2 changed files with 3 additions and 8 deletions

View File

@@ -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

View File

@@ -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