public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
tsaleh (author)
Mon Jan 21 06:38:40 -0800 2008
commit  99cf8cad5d288e0b0346dc4e4a83a6b5fdb5d32a
tree    58cd481b1f192acc2c8772ec130e59a25c70f11f
parent  b5251e9f2b641c75de16c04e732ee00791672ace
...
233
234
235
236
 
 
 
 
 
 
 
 
 
237
238
239
...
242
243
244
 
 
 
 
 
 
 
 
245
246
247
...
233
234
235
 
236
237
238
239
240
241
242
243
244
245
246
247
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
0
@@ -233,7 +233,15 @@ module ThoughtBot # :nodoc:
0
           assert object.errors.on(attribute), "There are no errors set on #{attribute} after being set to \"#{v}\""
0
           assert_contains(object.errors.on(attribute), low_message, "when set to \"#{v}\"")
0
         end
0
-
0
+
0
+ should "allow #{attribute} to be #{min}" do
0
+ v = min
0
+ assert object = klass.find(:first), "Can't find first #{klass}"
0
+ object.send("#{attribute}=", v)
0
+ object.save
0
+ assert_does_not_contain(object.errors.on(attribute), low_message, "when set to \"#{v}\"")
0
+ end
0
+
0
         should "not allow #{attribute} to be more than #{max}" do
0
           v = max + 1
0
           assert object = klass.find(:first), "Can't find first #{klass}"
0
@@ -242,6 +250,14 @@ module ThoughtBot # :nodoc:
0
           assert object.errors.on(attribute), "There are no errors set on #{attribute} after being set to \"#{v}\""
0
           assert_contains(object.errors.on(attribute), high_message, "when set to \"#{v}\"")
0
         end
0
+
0
+ should "allow #{attribute} to be #{max}" do
0
+ v = max
0
+ assert object = klass.find(:first), "Can't find first #{klass}"
0
+ object.send("#{attribute}=", v)
0
+ object.save
0
+ assert_does_not_contain(object.errors.on(attribute), high_message, "when set to \"#{v}\"")
0
+ end
0
       end
0
       
0
       # Ensure that the attribute is numeric

Comments

    No one has commented yet.