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

Version Path
rails_uploads-0.2.9 test/unit/local_file_string_test.rb
rails_uploads-0.2.8 test/unit/local_file_string_test.rb
rails_uploads-0.2.7 test/unit/local_file_string_test.rb
rails_uploads-0.2.6 test/unit/local_file_string_test.rb
rails_uploads-0.2.5 test/unit/local_file_string_test.rb
rails_uploads-0.2.4 test/unit/local_file_string_test.rb
rails_uploads-0.2.3 test/unit/local_file_string_test.rb
rails_uploads-0.2.2 test/unit/local_file_string_test.rb
rails_uploads-0.2.1 test/unit/local_file_string_test.rb
rails_uploads-0.2.0 test/unit/local_file_string_test.rb