Commit 0188bbf6 by Tute Costa Committed by GitHub

Remove Tempfile tests from Thumbnail spec (#2338)

* Remove old Tempfile tests from Thumbnail spec
* Move Tempfile tests to tempfile_spec.rb
parents ce919726 eb120451
require "spec_helper"
describe Paperclip::Tempfile do
context "A Paperclip Tempfile" do
before do
@tempfile = described_class.new(["file", ".jpg"])
end
after { @tempfile.close }
it "has its path contain a real extension" do
assert_equal ".jpg", File.extname(@tempfile.path)
end
it "is a real Tempfile" do
assert @tempfile.is_a?(::Tempfile)
end
end
context "Another Paperclip Tempfile" do
before do
@tempfile = described_class.new("file")
end
after { @tempfile.close }
it "does not have an extension if not given one" do
assert_equal "", File.extname(@tempfile.path)
end
it "is a real Tempfile" do
assert @tempfile.is_a?(::Tempfile)
end
end
end
require 'spec_helper' require 'spec_helper'
describe Paperclip::Thumbnail do describe Paperclip::Thumbnail do
context "A Paperclip Tempfile" do
before do
@tempfile = Paperclip::Tempfile.new(["file", ".jpg"])
end
after { @tempfile.close }
it "has its path contain a real extension" do
assert_equal ".jpg", File.extname(@tempfile.path)
end
it "is a real Tempfile" do
assert @tempfile.is_a?(::Tempfile)
end
end
context "Another Paperclip Tempfile" do
before do
@tempfile = Paperclip::Tempfile.new("file")
end
after { @tempfile.close }
it "does not have an extension if not given one" do
assert_equal "", File.extname(@tempfile.path)
end
it "is a real Tempfile" do
assert @tempfile.is_a?(::Tempfile)
end
end
context "An image" do context "An image" do
before do before do
@file = File.new(fixture_file("5k.png"), 'rb') @file = File.new(fixture_file("5k.png"), 'rb')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment