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
afc8f4bc
Commit
afc8f4bc
authored
Dec 03, 2012
by
Jon Berke
Committed by
Jon Yurek
Dec 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds integration test for style-specific s3 headers and metadata
parent
adabe469
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
test/integration_test.rb
+17
-1
No files found.
test/integration_test.rb
View file @
afc8f4bc
...
...
@@ -532,7 +532,13 @@ class IntegrationTest < Test::Unit::TestCase
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
:medium
=>
"100x100"
,
:thumb
=>
[
"32x32#"
,
:gif
]
},
:thumb
=>
[
"32x32#"
,
:gif
],
:custom
=>
{
:geometry
=>
"32x32#"
,
:s3_headers
=>
{
'Cache-Control'
=>
'max-age=31557600'
},
:s3_metadata
=>
{
'foo'
=>
'bar'
}
}
},
:storage
=>
:s3
,
:s3_credentials
=>
File
.
new
(
fixture_file
(
's3.yml'
)),
:s3_options
=>
{
:logger
=>
Paperclip
.
logger
},
...
...
@@ -659,6 +665,16 @@ class IntegrationTest < Test::Unit::TestCase
assert_equal
'image/png'
,
headers
[
'content-type'
]
end
should
"have the right style-specific headers"
do
headers
=
s3_headers_for
(
@dummy
.
avatar
,
:custom
)
assert_equal
'max-age=31557600'
,
headers
[
'cache-control'
]
end
should
"have the right style-specific metadata"
do
headers
=
s3_headers_for
(
@dummy
.
avatar
,
:custom
)
assert_equal
'bar'
,
headers
[
'x-amz-meta-foo'
]
end
context
"with non-english character in the file name"
do
setup
do
@file
.
stubs
(
:original_filename
).
returns
(
"クリップ.png"
)
...
...
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