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
9bfcebc8
Commit
9bfcebc8
authored
Oct 31, 2012
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some before_shoulds
parent
eaa6b871
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
test/style_test.rb
+18
-14
No files found.
test/style_test.rb
View file @
9bfcebc8
...
...
@@ -96,40 +96,44 @@ class StyleTest < Test::Unit::TestCase
end
context
"An attachment with :convert_options"
do
s
etup
do
s
hould
"not have called extra_options_for(:thumb/:large) on initialization"
do
@attachment
=
attachment
:path
=>
":basename.:extension"
,
:styles
=>
{
:thumb
=>
"100x100"
,
:large
=>
"400x400"
},
:convert_options
=>
{
:all
=>
"-do_stuff"
,
:thumb
=>
"-thumbnailize"
}
@style
=
@attachment
.
styles
[
:thumb
]
@file
=
StringIO
.
new
(
"..."
)
@file
.
stubs
(
:original_filename
).
returns
(
"file.jpg"
)
end
before_should
"not have called extra_options_for(:thumb/:large) on initialization"
do
@attachment
.
expects
(
:extra_options_for
).
never
@style
=
@attachment
.
styles
[
:thumb
]
end
should
"call extra_options_for(:thumb/:large) when convert options are requested"
do
@attachment
=
attachment
:path
=>
":basename.:extension"
,
:styles
=>
{
:thumb
=>
"100x100"
,
:large
=>
"400x400"
},
:convert_options
=>
{
:all
=>
"-do_stuff"
,
:thumb
=>
"-thumbnailize"
}
@style
=
@attachment
.
styles
[
:thumb
]
@file
=
StringIO
.
new
(
"..."
)
@file
.
stubs
(
:original_filename
).
returns
(
"file.jpg"
)
@attachment
.
expects
(
:extra_options_for
).
with
(
:thumb
)
@attachment
.
styles
[
:thumb
].
convert_options
end
end
context
"An attachment with :source_file_options"
do
s
etup
do
s
hould
"not have called extra_source_file_options_for(:thumb/:large) on initialization"
do
@attachment
=
attachment
:path
=>
":basename.:extension"
,
:styles
=>
{
:thumb
=>
"100x100"
,
:large
=>
"400x400"
},
:source_file_options
=>
{
:all
=>
"-density 400"
,
:thumb
=>
"-depth 8"
}
@style
=
@attachment
.
styles
[
:thumb
]
@file
=
StringIO
.
new
(
"..."
)
@file
.
stubs
(
:original_filename
).
returns
(
"file.jpg"
)
end
before_should
"not have called extra_source_file_options_for(:thumb/:large) on initialization"
do
@attachment
.
expects
(
:extra_source_file_options_for
).
never
@style
=
@attachment
.
styles
[
:thumb
]
end
should
"call extra_options_for(:thumb/:large) when convert options are requested"
do
@attachment
=
attachment
:path
=>
":basename.:extension"
,
:styles
=>
{
:thumb
=>
"100x100"
,
:large
=>
"400x400"
},
:source_file_options
=>
{
:all
=>
"-density 400"
,
:thumb
=>
"-depth 8"
}
@style
=
@attachment
.
styles
[
:thumb
]
@file
=
StringIO
.
new
(
"..."
)
@file
.
stubs
(
:original_filename
).
returns
(
"file.jpg"
)
@attachment
.
expects
(
:extra_source_file_options_for
).
with
(
:thumb
)
@attachment
.
styles
[
:thumb
].
source_file_options
end
...
...
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