Commit 1f989aef by Luke Griffiths

responding to code review comments

parent 675dd9a3
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
......
...@@ -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"
......
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