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
1f989aef
Commit
1f989aef
authored
Feb 03, 2012
by
Luke Griffiths
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
responding to code review comments
parent
675dd9a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
15 deletions
+3
-15
test/attachment_options_test.rb
+3
-8
test/paperclip_test.rb
+0
-7
No files found.
test/attachment_options_test.rb
View file @
1f989aef
require
'./test/helper'
require
'./test/helper'
class
AttachmentOptionsTest
<
Test
::
Unit
::
TestCase
class
AttachmentOptionsTest
<
Test
::
Unit
::
TestCase
should
"exist"
do
Paperclip
::
AttachmentOptions
end
should
"be a Hash"
do
should
"be a Hash"
do
attachment_options
=
Paperclip
::
AttachmentOptions
.
new
({})
assert_kind_of
Hash
,
Paperclip
::
AttachmentOptions
.
new
({})
assert
attachment_options
.
is_a?
(
Hash
),
"attachment_options is not a Hash"
end
end
should
"add a default empty validations"
do
should
"add a default empty validations"
do
...
@@ -24,7 +19,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
...
@@ -24,7 +19,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
end
end
should
"respond to []"
do
should
"respond to []"
do
Paperclip
::
AttachmentOptions
.
new
({})[
:foo
]
assert
Paperclip
::
AttachmentOptions
.
new
({}).
respond_to?
(
:[]
)
end
end
should
"deliver the specified options through []"
do
should
"deliver the specified options through []"
do
...
@@ -34,7 +29,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
...
@@ -34,7 +29,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
end
end
should
"respond to []="
do
should
"respond to []="
do
Paperclip
::
AttachmentOptions
.
new
({})[
:foo
]
=
"bar"
assert
Paperclip
::
AttachmentOptions
.
new
({}).
respond_to?
(
:[]=
)
end
end
should
"remember options set with []="
do
should
"remember options set with []="
do
...
...
test/paperclip_test.rb
View file @
1f989aef
...
@@ -98,13 +98,6 @@ class PaperclipTest < Test::Unit::TestCase
...
@@ -98,13 +98,6 @@ class PaperclipTest < Test::Unit::TestCase
end
end
end
end
context
"An ActiveRecord model responding to has_attached_file"
do
should
"pass the options to Paperclip::AttachmentOptions.new"
do
Paperclip
::
AttachmentOptions
.
expects
(
:new
).
with
({
"test"
=>
"hash"
}).
returns
(
MockAttachmentOptions
.
new
)
rebuild_model
"test"
=>
"hash"
end
end
context
"An ActiveRecord model with an 'avatar' attachment"
do
context
"An ActiveRecord model with an 'avatar' attachment"
do
setup
do
setup
do
rebuild_model
:path
=>
"tmp/:class/omg/:style.:extension"
rebuild_model
:path
=>
"tmp/:class/omg/:style.:extension"
...
...
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