Commit 28a83058 by Jon Yurek

Fixed issue with my own tests and the matchers.

parent 832298b6
......@@ -5,7 +5,7 @@ class HaveAttachedFileMatcherTest < Test::Unit::TestCase
setup do
@dummy_class = reset_class "Dummy"
reset_table "dummies"
@matcher = have_attached_file(:avatar)
@matcher = self.class.have_attached_file(:avatar)
end
should "reject a class with no attachment" do
......
......@@ -8,7 +8,7 @@ class ValidateAttachmentContentTypeMatcherTest < Test::Unit::TestCase
end
@dummy_class = reset_class "Dummy"
@dummy_class.has_attached_file :avatar
@matcher = validate_attachment_content_type(:avatar).
@matcher = self.class.validate_attachment_content_type(:avatar).
allowing(%w(image/png image/jpeg)).
rejecting(%w(audio/mp3 application/octet-stream))
end
......
......@@ -6,7 +6,7 @@ class ValidateAttachmentPresenceMatcherTest < Test::Unit::TestCase
reset_table("dummies"){|d| d.string :avatar_file_name }
@dummy_class = reset_class "Dummy"
@dummy_class.has_attached_file :avatar
@matcher = validate_attachment_presence(:avatar)
@matcher = self.class.validate_attachment_presence(:avatar)
end
should "reject a class with no validation" do
......
......@@ -11,7 +11,7 @@ class ValidateAttachmentSizeMatcherTest < Test::Unit::TestCase
end
context "of limited size" do
setup{ @matcher = validate_attachment_size(:avatar).in(256..1024) }
setup{ @matcher = self.class.validate_attachment_size(:avatar).in(256..1024) }
should "reject a class with no validation" do
assert_rejects @matcher, @dummy_class
......@@ -34,7 +34,7 @@ class ValidateAttachmentSizeMatcherTest < Test::Unit::TestCase
end
context "validates_attachment_size with infinite range" do
setup{ @matcher = validate_attachment_size(:avatar) }
setup{ @matcher = self.class.validate_attachment_size(:avatar) }
should "accept a class with an upper limit" do
@dummy_class.validates_attachment_size :avatar, :less_than => 1
......
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