carrierwaveuploader--carrie.../features/step_definitions/caching_steps.rb

13 lines
387 B
Ruby

Given /^the file '(.*?)' is cached file at '(.*?)'$/ do |file, cached|
FileUtils.mkdir_p(File.dirname(file_path(cached)))
FileUtils.cp(file_path(file), file_path(cached))
end
When /^I cache the file '(.*?)'$/ do |file|
@uploader.cache!(File.open(file_path(file)))
end
When /^I retrieve the cache name '(.*?)' from the cache$/ do |name|
@uploader.retrieve_from_cache!(name)
end