Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
responding to code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporky023 committed Feb 3, 2012
1 parent 675dd9a commit 1f989ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
11 changes: 3 additions & 8 deletions test/attachment_options_test.rb
@@ -1,13 +1,8 @@
require './test/helper'

class AttachmentOptionsTest < Test::Unit::TestCase
should "exist" do
Paperclip::AttachmentOptions
end

should "be a Hash" do
attachment_options = Paperclip::AttachmentOptions.new({})
assert attachment_options.is_a?(Hash), "attachment_options is not a Hash"
assert_kind_of Hash, Paperclip::AttachmentOptions.new({})
end

should "add a default empty validations" do
Expand All @@ -24,7 +19,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
end

should "respond to []" do
Paperclip::AttachmentOptions.new({})[:foo]
assert Paperclip::AttachmentOptions.new({}).respond_to?(:[])
end

should "deliver the specified options through []" do
Expand All @@ -34,7 +29,7 @@ class AttachmentOptionsTest < Test::Unit::TestCase
end

should "respond to []=" do
Paperclip::AttachmentOptions.new({})[:foo] = "bar"
assert Paperclip::AttachmentOptions.new({}).respond_to?(:[]=)
end

should "remember options set with []=" do
Expand Down
7 changes: 0 additions & 7 deletions test/paperclip_test.rb
Expand Up @@ -98,13 +98,6 @@ class Dummy2 < ActiveRecord::Base
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
setup do
rebuild_model :path => "tmp/:class/omg/:style.:extension"
Expand Down

0 comments on commit 1f989ae

Please sign in to comment.