Commit f07487f6 by Jon Yurek

#97 Fix for shoulda macros

parent 56477408
...@@ -31,16 +31,17 @@ module Paperclip ...@@ -31,16 +31,17 @@ module Paperclip
@attachment.assign(nil) @attachment.assign(nil)
end end
should "have a :presence validation error" do should "have a :presence validation error" do
assert @assignment.errors[:presence] assert @attachment.errors[:presence]
end end
end end
context "when the assignment is valid" do context "when the assignment is valid" do
setup do setup do
@file = StringIO.new(".")
@attachment = klass.new.send(name) @attachment = klass.new.send(name)
@attachment.assign(nil) @attachment.assign(@file)
end end
should "have a :presence validation error" do should "have a :presence validation error" do
assert ! @assignment.errors[:presence] assert ! @attachment.errors[:presence]
end end
end end
end end
...@@ -65,7 +66,7 @@ module Paperclip ...@@ -65,7 +66,7 @@ module Paperclip
@attachment.assign(@file) @attachment.assign(@file)
end end
should "not have a :content_type validation error" do should "not have a :content_type validation error" do
assert ! @assignment.errors[:content_type] assert ! @attachment.errors[:content_type]
end end
end end
end end
...@@ -79,7 +80,7 @@ module Paperclip ...@@ -79,7 +80,7 @@ module Paperclip
@attachment.assign(@file) @attachment.assign(@file)
end end
should "have a :content_type validation error" do should "have a :content_type validation error" do
assert @assignment.errors[:content_type] assert @attachment.errors[:content_type]
end end
end end
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