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
071dc598
Commit
071dc598
authored
Aug 01, 2008
by
Henrik N
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also test that new_user.avatar = old_user.avatar nils with a nil avatar.
parent
009aba0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
test/integration_test.rb
+28
-13
No files found.
test/integration_test.rb
View file @
071dc598
...
...
@@ -199,20 +199,35 @@ class IntegrationTest < Test::Unit::TestCase
assert_equal
"5k.png"
,
@dummy
.
avatar_file_name
end
should
"assign images from other Paperclips as well"
do
@dummy2
=
Dummy
.
new
@file2
=
File
.
new
(
File
.
join
(
FIXTURES_DIR
,
"12k.png"
))
assert
@dummy2
.
avatar
=
@file2
@dummy2
.
save
assert_not_equal
`identify -format "%wx%h"
#{
@dummy
.
avatar
.
to_file
(
:original
).
path
}
`
,
`identify -format "%wx%h"
#{
@dummy2
.
avatar
.
to_file
(
:original
).
path
}
`
context
"that is assigned its file from another Paperclip attachment"
do
setup
do
@dummy2
=
Dummy
.
new
@file2
=
File
.
new
(
File
.
join
(
FIXTURES_DIR
,
"12k.png"
))
assert
@dummy2
.
avatar
=
@file2
@dummy2
.
save
end
assert
@dummy
.
avatar
=
@dummy2
.
avatar
@dummy
.
save
assert_equal
`identify -format "%wx%h"
#{
@dummy
.
avatar
.
to_file
(
:original
).
path
}
`
,
`identify -format "%wx%h"
#{
@dummy2
.
avatar
.
to_file
(
:original
).
path
}
`
end
should
"work when assigned a file"
do
assert_not_equal
`identify -format "%wx%h"
#{
@dummy
.
avatar
.
to_file
(
:original
).
path
}
`
,
`identify -format "%wx%h"
#{
@dummy2
.
avatar
.
to_file
(
:original
).
path
}
`
assert
@dummy
.
avatar
=
@dummy2
.
avatar
@dummy
.
save
assert_equal
`identify -format "%wx%h"
#{
@dummy
.
avatar
.
to_file
(
:original
).
path
}
`
,
`identify -format "%wx%h"
#{
@dummy2
.
avatar
.
to_file
(
:original
).
path
}
`
end
should
"work when assigned a nil file"
do
@dummy2
.
avatar
=
nil
@dummy2
.
save
@dummy
.
avatar
=
@dummy2
.
avatar
@dummy
.
save
assert
!
@dummy
.
avatar?
end
end
end
if
ENV
[
'S3_TEST_BUCKET'
]
...
...
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