Commit dbb7e043 by Jon Yurek

Test for .attachment_definitions

parent ceb43f1a
...@@ -92,7 +92,7 @@ module Paperclip ...@@ -92,7 +92,7 @@ module Paperclip
module ClassMethods module ClassMethods
def attachment_definitions def attachment_definitions
Paperclip::AttachmentRegistry.definitions_for(self.class) Paperclip::AttachmentRegistry.definitions_for(self)
end end
end end
end end
......
require './test/helper'
class AttachmentDefinitionsTest < Test::Unit::TestCase
should 'return all of the attachments on the class' do
reset_class "Dummy"
Dummy.has_attached_file :avatar, {:path => "abc"}
Dummy.has_attached_file :other_attachment, {:url => "123"}
expected = {:avatar => {:path => "abc"}, :other_attachment => {:url => "123"}}
assert_equal expected, Dummy.attachment_definitions
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment