Sha256: a698008bf49d89b400bf296dfe72d74bdec1ac9eaa6aebe99296e4d8b2def647

Contents?: true

Size: 907 Bytes

Versions: 10

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

describe Paperclip::TempfileFactory do
  it "is able to generate a tempfile with the right name" do
    file = subject.generate("omg.png")
    assert File.extname(file.path), "png"
  end

  it "is 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

  it "is 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

  it "is 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

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

Version data entries

10 entries across 8 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/paperclip-4.2.4/spec/paperclip/tempfile_factory_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/paperclip-4.2.4/spec/paperclip/tempfile_factory_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.2/spec/paperclip/tempfile_factory_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.3/spec/paperclip/tempfile_factory_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.4/spec/paperclip/tempfile_factory_spec.rb
paperclip-4.2.4 spec/paperclip/tempfile_factory_spec.rb
paperclip-4.2.3 spec/paperclip/tempfile_factory_spec.rb
paperclip-4.2.2 spec/paperclip/tempfile_factory_spec.rb
paperclip-4.2.1 spec/paperclip/tempfile_factory_spec.rb
paperclip-4.2.0 spec/paperclip/tempfile_factory_spec.rb