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
ed5cd9f1
Commit
ed5cd9f1
authored
Jan 27, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the questionmark filename test for real file
parent
bdfeebda
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
36 deletions
+26
-36
test/fixtures/question?mark.png
+0
-0
test/storage/s3_live_test.rb
+0
-36
test/storage/s3_test.rb
+26
-0
No files found.
test/fixtures/question?mark.png
deleted
100644 → 0
View file @
bdfeebda
1.58 KB
test/storage/s3_live_test.rb
View file @
ed5cd9f1
...
...
@@ -99,42 +99,6 @@ unless ENV["S3_BUCKET"].blank?
end
end
context
"An attachment that uses S3 for storage and has a question mark in file name"
do
setup
do
rebuild_model
:styles
=>
{
:thumb
=>
"100x100"
,
:square
=>
"32x32#"
},
:storage
=>
:s3
,
:bucket
=>
ENV
[
"S3_BUCKET"
],
:s3_credentials
=>
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
,
"fixtures"
,
"s3.yml"
))
Dummy
.
delete_all
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'question?mark.png'
),
'rb'
)
@dummy
.
save
end
should
"return an unescaped version for path"
do
assert_match
/.+\/question\?mark\.png/
,
@dummy
.
avatar
.
path
end
should
"return an escaped version for url"
do
assert_match
/.+\/question%3Fmark\.png/
,
@dummy
.
avatar
.
url
end
should
"be accessible"
do
assert_success_response
@dummy
.
avatar
.
url
end
should
"be accessible with an expiring url"
do
assert_success_response
@dummy
.
avatar
.
expiring_url
end
should
"be destroyable"
do
url
=
@dummy
.
avatar
.
url
@dummy
.
destroy
assert_not_found_response
url
end
end
context
"An attachment that uses S3 for storage and uses AES256 encryption"
do
setup
do
rebuild_model
:styles
=>
{
:thumb
=>
"100x100"
,
:square
=>
"32x32#"
},
...
...
test/storage/s3_test.rb
View file @
ed5cd9f1
...
...
@@ -231,6 +231,32 @@ class S3Test < Test::Unit::TestCase
end
end
context
"An attachment that uses S3 for storage and has a question mark in file name"
do
setup
do
rebuild_model
:styles
=>
{
:large
=>
[
'500x500#'
,
:jpg
]
},
:storage
=>
:s3
,
:bucket
=>
"bucket"
,
:s3_credentials
=>
{
'access_key_id'
=>
"12345"
,
'secret_access_key'
=>
"54321"
}
file
=
StringIO
.
new
(
"."
)
file
.
original_filename
=
"question?mark.png"
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
file
@dummy
.
save
end
should
"return an unescaped version for path"
do
assert_match
/.+\/question\?mark\.png/
,
@dummy
.
avatar
.
path
end
should
"return an escaped version for url"
do
assert_match
/.+\/question%3Fmark\.png/
,
@dummy
.
avatar
.
url
end
end
context
""
do
setup
do
rebuild_model
:storage
=>
:s3
,
...
...
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