Commit 73fd3167 by Jon Yurek

Test allowing nil geometry

parent f3878335
...@@ -28,7 +28,7 @@ module Paperclip ...@@ -28,7 +28,7 @@ module Paperclip
def initialize(file, options = {}, attachment = nil) def initialize(file, options = {}, attachment = nil)
super super
geometry = options[:geometry].to_s # this is not an option geometry = options[:geometry].to_s
@file = file @file = file
@crop = geometry[-1,1] == '#' @crop = geometry[-1,1] == '#'
@target_geometry = options.fetch(:string_geometry_parser, Geometry).parse(geometry) @target_geometry = options.fetch(:string_geometry_parser, Geometry).parse(geometry)
......
...@@ -42,7 +42,8 @@ describe Paperclip::Thumbnail do ...@@ -42,7 +42,8 @@ describe Paperclip::Thumbnail do
[["600x600>", "434x66"], [["600x600>", "434x66"],
["400x400>", "400x61"], ["400x400>", "400x61"],
["32x32<", "434x66"] ["32x32<", "434x66"],
[nil, "434x66"]
].each do |args| ].each do |args|
context "being thumbnailed with a geometry of #{args[0]}" do context "being thumbnailed with a geometry of #{args[0]}" do
before do before do
...@@ -55,7 +56,7 @@ describe Paperclip::Thumbnail do ...@@ -55,7 +56,7 @@ describe Paperclip::Thumbnail do
end end
it "reports the correct target geometry" do it "reports the correct target geometry" do
assert_equal args[0], @thumb.target_geometry.to_s assert_equal args[0].to_s, @thumb.target_geometry.to_s
end end
context "when made" do context "when made" do
......
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