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
f647d680
Commit
f647d680
authored
Apr 17, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for attachment assignment from S3
parent
3f1d30fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
test/storage/s3_live_test.rb
+15
-2
No files found.
test/storage/s3_live_test.rb
View file @
f647d680
...
@@ -12,9 +12,11 @@ unless ENV["S3_BUCKET"].blank?
...
@@ -12,9 +12,11 @@ unless ENV["S3_BUCKET"].blank?
:path
=>
":class/:attachment/:id/:style.:extension"
,
:path
=>
":class/:attachment/:id/:style.:extension"
,
:s3_credentials
=>
@s3_credentials
:s3_credentials
=>
@s3_credentials
@dummy
=
Dummy
.
new
@attachment
=
Dummy
.
new
.
avatar
@file
=
File
.
new
(
fixture_file
(
"5k.png"
))
@file
=
File
.
new
(
fixture_file
(
"5k.png"
))
end
should
"not raise any error"
do
@attachment
=
Dummy
.
new
.
avatar
@attachment
.
assign
(
@file
)
@attachment
.
assign
(
@file
)
@attachment
.
save
@attachment
.
save
...
@@ -23,6 +25,16 @@ unless ENV["S3_BUCKET"].blank?
...
@@ -23,6 +25,16 @@ unless ENV["S3_BUCKET"].blank?
@attachment2
.
save
@attachment2
.
save
end
end
should
"allow assignment from another S3 object"
do
@attachment
=
Dummy
.
new
.
avatar
@attachment
.
assign
(
@file
)
@attachment
.
save
@attachment2
=
Dummy
.
new
.
avatar
@attachment2
.
assign
(
@attachment
)
@attachment2
.
save
end
teardown
{
[
@s3_credentials
,
@file
].
each
(
&
:close
)
}
teardown
{
[
@s3_credentials
,
@file
].
each
(
&
:close
)
}
end
end
...
@@ -37,6 +49,7 @@ unless ENV["S3_BUCKET"].blank?
...
@@ -37,6 +49,7 @@ unless ENV["S3_BUCKET"].blank?
@dummy
=
Dummy
.
new
@dummy
=
Dummy
.
new
end
end
should
"return nil"
do
should
"return nil"
do
assert_nil
@dummy
.
avatar
.
expiring_url
assert_nil
@dummy
.
avatar
.
expiring_url
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