One more note on RSpec 3.0, this time one useful function that mocks File Upload , saves file/archive content to memory so after it you can do whatever your soul wants with it. Test file/archive should exist in the file system.
def mock_archive_upload(archive_path, type) return ActionDispatch::Http::UploadedFile.new(:tempfile => File.new(Rails.root + archive_path , :type => type, :filename => File.basename(File.new(Rails.root + archive_path)))) end
e.g of use:
#saves archive into memory so it can be manipulated in tests mock_archive_upload("../fixtues/my_archive.zip", "application/zip")