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
11a09fbf
Commit
11a09fbf
authored
Oct 15, 2011
by
mpd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for files with question mark in the name, including failing test for the expiring url case.
parent
c4a57fff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
test/fixtures/question?mark.png
+0
-0
test/storage/s3_live_test.rb
+38
-0
No files found.
test/fixtures/question?mark.png
0 → 100644
View file @
11a09fbf
1.58 KB
test/storage/s3_live_test.rb
View file @
11a09fbf
...
@@ -84,5 +84,43 @@ unless ENV["S3_TEST_BUCKET"].blank?
...
@@ -84,5 +84,43 @@ unless ENV["S3_TEST_BUCKET"].blank?
assert_match
/404 Not Found/
,
`curl -I
#{
url
}
`
assert_match
/404 Not Found/
,
`curl -I
#{
url
}
`
end
end
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_TEST_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
teardown
{
@dummy
.
destroy
}
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_match
/200 OK/
,
`curl -I "
#{
@dummy
.
avatar
.
url
}
"`
end
should
"be accessible with an expiring url"
do
assert_match
/200 OK/
,
`curl -I "
#{
@dummy
.
avatar
.
expiring_url
}
"`
end
should
"be destroyable"
do
url
=
@dummy
.
avatar
.
url
@dummy
.
destroy
assert_match
/404 Not Found/
,
`curl -I "
#{
url
}
"`
end
end
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