Sha256: 21953ae13302bba48f6dbb85bf5ed00f379eaa08bf48d33c1881ebded47572fa
Contents?: true
Size: 688 Bytes
Versions: 10
Compression:
Stored size: 688 Bytes
Contents
require 'test_helper' class LocalFileStringTest < ActiveSupport::TestCase setup do FileUtils.mkdir_p Rails.root.join('tmp', 'uploads', 'files') filename = 'file.txt' FileUtils.cp fixture_file_upload("/#{filename}", 'text/plain'), Rails.root.join('tmp', 'uploads', 'files', filename) @file = RailsUploads::Types::File.new(filename) end test "should maintain properties and delete correctly" do assert @file.exists? assert_equal 11, @file.size assert_equal '.txt', @file.extname uploads_path = Rails.root.join('tmp', 'uploads', 'files', @file.filename) @file.delete assert !::File.exists?(uploads_path) assert !@file.exists? end end
Version data entries
10 entries across 10 versions & 1 rubygems