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
073c06c1
Commit
073c06c1
authored
Jul 10, 2012
by
Tom Counsell
Committed by
Prem Sichanugrist
Jul 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extra tests for #947 to check works in more situations
parent
b256381c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
test/integration_test.rb
+20
-3
No files found.
test/integration_test.rb
View file @
073c06c1
...
@@ -641,7 +641,7 @@ class IntegrationTest < Test::Unit::TestCase
...
@@ -641,7 +641,7 @@ class IntegrationTest < Test::Unit::TestCase
end
end
end
end
context
"Copying attachment between models"
do
context
"Copying attachment
s
between models"
do
setup
do
setup
do
rebuild_model
rebuild_model
@file
=
File
.
new
(
fixture_file
(
"5k.png"
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
"5k.png"
),
'rb'
)
...
@@ -649,11 +649,28 @@ class IntegrationTest < Test::Unit::TestCase
...
@@ -649,11 +649,28 @@ class IntegrationTest < Test::Unit::TestCase
teardown
{
@file
.
close
}
teardown
{
@file
.
close
}
should
"should succeed when attachment is empty"
do
should
"succeed when original attachment is a file"
do
original
=
Dummy
.
new
original
.
avatar
=
@file
assert
original
.
save
copy
=
Dummy
.
new
copy
.
avatar
=
original
.
avatar
assert
copy
.
save
assert
copy
.
avatar
.
present?
end
should
"succeed when original attachment is empty"
do
original
=
Dummy
.
create!
original
=
Dummy
.
create!
copy
=
Dummy
.
new
copy
=
Dummy
.
new
copy
.
avatar
=
@file
assert
copy
.
save
assert
copy
.
avatar
.
present?
copy
.
avatar
=
original
.
avatar
copy
.
avatar
=
original
.
avatar
copy
.
save
assert
copy
.
save
assert
!
copy
.
avatar
.
present?
assert
!
copy
.
avatar
.
present?
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