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
25628d13
Commit
25628d13
authored
May 13, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for reprocess\!
parent
4e9acd69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
test/test_integration.rb
+31
-0
No files found.
test/test_integration.rb
View file @
25628d13
...
...
@@ -18,6 +18,37 @@ class IntegrationTest < Test::Unit::TestCase
end
end
context
"An attachment"
do
setup
do
rebuild_model
:styles
=>
{
:thumb
=>
"50x50#"
}
@dummy
=
Dummy
.
new
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"fixtures"
,
"5k.png"
))
@dummy
.
avatar
=
@file
assert
@dummy
.
save
end
should
"create its thumbnails properly"
do
assert_match
/\b50x50\b/
,
`identify '
#{
@dummy
.
avatar
.
path
(
:thumb
)
}
'`
end
context
"redefining its attachment styles"
do
setup
do
Dummy
.
class_eval
do
has_attached_file
:avatar
,
:styles
=>
{
:thumb
=>
"150x25#"
}
end
@d2
=
Dummy
.
find
(
@dummy
.
id
)
@d2
.
avatar
.
reprocess!
@d2
.
save
end
should
"create its thumbnails properly"
do
assert_match
/\b150x25\b/
,
`identify '
#{
@dummy
.
avatar
.
path
(
:thumb
)
}
'`
end
end
end
context
"A model with no attachment validation"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
...
...
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