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
7d2904de
Commit
7d2904de
authored
Jan 30, 2015
by
Agustin Cavilliotti
Committed by
Jon Yurek
Feb 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Arrangements in the spec file to take care of some @houndci comments
parent
1d621d81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
spec/paperclip/attachment_registry_spec.rb
+21
-9
No files found.
spec/paperclip/attachment_registry_spec.rb
View file @
7d2904de
...
...
@@ -54,38 +54,48 @@ describe 'Attachment Registry' do
greeter:
{
ciao:
'greeting'
}
}
foo
=
Class
.
new
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
{
yo:
'greeting'
})
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:greeter
,
{
ciao:
'greeting'
})
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
{
yo:
'greeting'
})
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:greeter
,
{
ciao:
'greeting'
})
definitions
=
Paperclip
::
AttachmentRegistry
.
definitions_for
(
foo
)
assert_equal
expected_definitions
,
definitions
end
it
"produces defintions for subclasses"
do
it
'produces defintions for subclasses'
do
expected_definitions
=
{
avatar:
{
yo:
'greeting'
}
}
foo
=
Class
.
new
bar
=
Class
.
new
(
foo
)
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
expected_definitions
[
:avatar
])
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
expected_definitions
[
:avatar
])
definitions
=
Paperclip
::
AttachmentRegistry
.
definitions_for
(
bar
)
assert_equal
expected_definitions
,
definitions
end
it
"produces defintions for subclasses but deep merging them"
do
it
'produces defintions for subclasses but deep merging them'
do
foo_definitions
=
{
avatar:
{
yo:
'greeting'
}
}
bar_definitions
=
{
avatar:
{
ciao:
'greeting'
}
}
expected_definitions
=
{
avatar:
{
yo:
'greeting'
,
ciao:
'greeting'
}
}
}
foo
=
Class
.
new
bar
=
Class
.
new
(
foo
)
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
foo_definitions
[
:avatar
])
Paperclip
::
AttachmentRegistry
.
register
(
bar
,
:avatar
,
bar_definitions
[
:avatar
])
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:avatar
,
foo_definitions
[
:avatar
])
Paperclip
::
AttachmentRegistry
.
register
(
bar
,
:avatar
,
bar_definitions
[
:avatar
])
definitions
=
Paperclip
::
AttachmentRegistry
.
definitions_for
(
bar
)
...
...
@@ -96,7 +106,9 @@ describe 'Attachment Registry' do
context
'.clear'
do
it
'removes all of the existing attachment definitions'
do
foo
=
Class
.
new
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:greeter
,
{
ciao:
'greeting'
})
Paperclip
::
AttachmentRegistry
.
register
(
foo
,
:greeter
,
{
ciao:
'greeting'
})
Paperclip
::
AttachmentRegistry
.
clear
...
...
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