Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
73fd3167
Commit
73fd3167
authored
May 30, 2014
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test allowing nil geometry
parent
f3878335
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/paperclip/thumbnail.rb
+1
-1
spec/paperclip/thumbnail_spec.rb
+3
-2
No files found.
lib/paperclip/thumbnail.rb
View file @
73fd3167
...
@@ -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
)
...
...
spec/paperclip/thumbnail_spec.rb
View file @
73fd3167
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment