0
@@ -64,16 +64,13 @@ class PaperclipTest < Test::Unit::TestCase
0
assert Dummy.new.respond_to?(:avatar=)
0
- [[:presence, nil, "5k.png", nil],
0
- [:size, {:in => 1..10240}, "5k.png", "12k.png"],
0
- [:content_type1,{:content_type => "image/png"}, "5k.png", "text.txt"],
0
- [:content_type2, {:content_type => :image}, "5k.png", "text.txt"],
0
- [:content_type3, {:content_type => "text/plain"}, "text.txt", "5k.png"],
0
- [:presence2, {:message => "error"}, "5k.png", nil, "error"],
0
- [:size2, {:in => 1..10240, :message => 'size is not between #{min} and #{max} bytes.'}, "5k.png", "12k.png", "size is not between 1 and 10240 bytes."],
0
- [:size3, {:in => 1..10240}, nil, "12k.png"],
0
- [:content_type4,{:content_type => "image/png", :message => "error"}, "5k.png", "text.txt", "error"],
0
- [:content_type5,{:content_type => "image/png"}, nil, "text.txt"]].each do |args|
0
+ [[:presence, nil, "5k.png", nil],
0
+ [:size, {:in => 1..10240}, "5k.png", "12k.png"],
0
+ [:size2, {:in => 1..10240}, nil, "12k.png"],
0
+ [:content_type1, {:content_type => "image/png"}, "5k.png", "text.txt"],
0
+ [:content_type2, {:content_type => "text/plain"}, "text.txt", "5k.png"],
0
+ [:content_type3, {:content_type => %r{image/.*}}, "5k.png", "text.txt"],
0
+ [:content_type4, {:content_type => "image/png"}, nil, "text.txt"]].each do |args|
0
context "with #{args[0]} validations" do
0
@@ -106,20 +103,20 @@ class PaperclipTest < Test::Unit::TestCase
0
- context "and an invalid file with :message" do
0
- @file = args[3] && File.new(File.join(FIXTURES_DIR, args[3]))
0
- should "have errors" do
0
- if args[1] && args[1][:message] && args[4]
0
- assert ! @dummy.avatar.valid?
0
- assert_equal 1, @dummy.avatar.errors.length
0
- assert_equal args[4], @dummy.avatar.errors[0]
0
+# context "and an invalid file with :message" do
0
+# @file = args[3] && File.new(File.join(FIXTURES_DIR, args[3]))
0
+# should "have errors" do
0
+# if args[1] && args[1][:message] && args[4]
0
+# @dummy.avatar = @file
0
+# assert ! @dummy.avatar.valid?
0
+# assert_equal 1, @dummy.avatar.errors.length
0
+# assert_equal args[4], @dummy.avatar.errors[0]
Comments
No one has commented yet.