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
5751624c
Commit
5751624c
authored
Nov 14, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integration test for content type
parent
aebbb7c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
test/integration_test.rb
+14
-0
No files found.
test/integration_test.rb
View file @
5751624c
...
...
@@ -274,6 +274,14 @@ class IntegrationTest < Test::Unit::TestCase
end
end
def
s3_headers_for
attachment
,
style
`curl --head '
#{
attachment
.
url
(
style
)
}
' 2>/dev/null`
.
split
(
"
\n
"
).
inject
({})
do
|
h
,
head
|
split_head
=
head
.
chomp
.
split
(
/\s*:\s*/
,
2
)
h
[
split_head
.
first
.
downcase
]
=
split_head
.
last
unless
split_head
.
empty?
h
end
end
context
"A model with an S3 attachment"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
"300x300>"
,
...
...
@@ -387,6 +395,12 @@ class IntegrationTest < Test::Unit::TestCase
@dummy
.
reload
assert_equal
"5k.png"
,
@dummy
.
avatar_file_name
end
should
"have the right content type"
do
headers
=
s3_headers_for
(
@dummy
.
avatar
,
:original
)
p
headers
assert_equal
'image/png'
,
headers
[
'content-type'
]
end
end
end
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