Skip to content

Commit

Permalink
Fixed broken tests that were caused by previous commit related to
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm5t authored and technoweenie committed Mar 15, 2008
1 parent ee40198 commit 18c0b2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/technoweenie/attachment_fu.rb
Expand Up @@ -71,8 +71,8 @@ def has_attachment(options = {})

with_options :foreign_key => 'parent_id' do |m|
m.has_many :thumbnails, :class_name => attachment_options[:thumbnail_class].to_s
m.belongs_to :parent, :class_name => base_class.to_s
end unless options[:thumbnails].empty?
m.belongs_to :parent, :class_name => base_class.to_s unless options[:thumbnails].empty?
end

storage_mod = Technoweenie::AttachmentFu::Backends.const_get("#{options[:storage].to_s.classify}Backend")
include storage_mod unless included_modules.include?(storage_mod)
Expand Down
8 changes: 5 additions & 3 deletions test/processors/rmagick_test.rb
Expand Up @@ -157,8 +157,10 @@ def test_should_use_thumbnail_subclass(klass = ImageWithThumbsClassFileAttachmen
assert_valid attachment
end
assert_kind_of ImageThumbnail, attachment.thumbnails.first
assert_equal attachment.id, attachment.thumbnails.first.parent.id
assert_kind_of FileAttachment, attachment.thumbnails.first.parent
if attachment.thumbnails.first.respond_to?(:parent)
assert_equal attachment.id, attachment.thumbnails.first.parent.id
assert_kind_of FileAttachment, attachment.thumbnails.first.parent
end
assert_equal 'rails_thumb.png', attachment.thumbnails.first.filename
assert_equal attachment.thumbnails.first.full_filename, attachment.full_filename(attachment.thumbnails.first.thumbnail),
"#full_filename does not use thumbnail class' path."
Expand Down Expand Up @@ -250,4 +252,4 @@ def test_flunk
puts "RMagick not installed, no tests running"
end
end
end
end

0 comments on commit 18c0b2d

Please sign in to comment.