Sha256: 840add55d3bf3214d40a287e4ddfe0f4c399df428b68cf48c55a478c9f61d047

Contents?: true

Size: 951 Bytes

Versions: 3

Compression:

Stored size: 951 Bytes

Contents

require './test/helper'

class Paperclip::TempfileFactoryTest < Test::Unit::TestCase
  should "be able to generate a tempfile with the right name" do
    file = subject.generate("omg.png")
    assert File.extname(file.path), "png"
  end

  should "be able to generate a tempfile with the right name with a tilde at the beginning" do
    file = subject.generate("~omg.png")
    assert File.extname(file.path), "png"
  end

  should "be able to generate a tempfile with the right name with a tilde at the end" do
    file = subject.generate("omg.png~")
    assert File.extname(file.path), "png"
  end

  should "be able to generate a tempfile from a file with a really long name" do
    filename = "#{"longfilename" * 100}.png"
    file = subject.generate(filename)
    assert File.extname(file.path), "png"
  end

  should 'be able to take nothing as a parameter and not error' do
   file = subject.generate
   assert File.exists?(file.path)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
paperclip-4.1.1 test/tempfile_factory_test.rb
paperclip-4.1.0 test/tempfile_factory_test.rb
paperclip-4.0.0 test/tempfile_factory_test.rb