<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -125,7 +125,8 @@ module Shoulda # :nodoc:
       #
       # Options:
       # * &lt;tt&gt;:message&lt;/tt&gt; - value the test expects to find in &lt;tt&gt;errors.on(:attribute)&lt;/tt&gt;.
-      #   Regexp or string.  Default = &lt;tt&gt;I18n.translate('activerecord.errors.messages.invalid')&lt;/tt&gt;
+      #   Regexp or string. If omitted, the test will pass if there is ANY error in
+      #   &lt;tt&gt;errors.on(:attribute)&lt;/tt&gt;.
       #
       # Example:
       #   should_not_allow_values_for :isbn, &quot;bad 1&quot;, &quot;bad 2&quot;</diff>
      <filename>lib/shoulda/active_record/macros.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,8 @@ module Shoulda # :nodoc:
       #
       # Options:
       # * &lt;tt&gt;with_message&lt;/tt&gt; - value the test expects to find in
-      #   &lt;tt&gt;errors.on(:attribute)&lt;/tt&gt;. Regexp or string. Defaults to the
-      #   translation for :invalid.
+      #   &lt;tt&gt;errors.on(:attribute)&lt;/tt&gt;. Regexp or string. If omitted,
+      #   the test looks for any errors in &lt;tt&gt;errors.on(:attribute)&lt;/tt&gt;.
       #
       # Example:
       #   it { should_not allow_value('bad').for(:isbn) }
@@ -36,7 +36,6 @@ module Shoulda # :nodoc:
 
         def matches?(instance)
           @instance = instance
-          @expected_message ||= :invalid
           if Symbol === @expected_message
             @expected_message = default_error_message(@expected_message)
           end
@@ -62,7 +61,7 @@ module Shoulda # :nodoc:
           @instance.valid?
           @errors = @instance.errors.on(@attribute)
           @errors = [@errors] unless @errors.is_a?(Array)
-          errors_match_regexp? || errors_match_string?
+          @expected_message ? (errors_match_regexp? || errors_match_string?) : (@errors != [nil])
         end
 
         def errors_match_regexp?
@@ -84,7 +83,8 @@ module Shoulda # :nodoc:
         end
 
         def expectation
-          &quot;errors to include #{@expected_message.inspect} &quot; &lt;&lt;
+          &quot;errors &quot; &lt;&lt;
+          (@expected_message ? &quot;to include #{@expected_message.inspect} &quot; : &quot;&quot;) &lt;&lt;
           &quot;when #{@attribute} is set to #{@value.inspect}&quot;
         end
 </diff>
      <filename>lib/shoulda/active_record/matchers/allow_value_matcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,4 +38,27 @@ class AllowValueMatcherTest &lt; ActiveSupport::TestCase # :nodoc:
     end
   end
 
+  context &quot;an attribute with several validations&quot; do
+    setup do
+      define_model :example, :attr =&gt; :string do
+        validates_presence_of     :attr
+        validates_length_of       :attr, :within =&gt; 1..5
+        validates_numericality_of :attr, :greater_than_or_equal_to =&gt; 1,
+                                         :less_than_or_equal_to    =&gt; 50000
+      end
+      @model = Example.new
+    end
+
+    should &quot;allow a good value&quot; do
+      assert_accepts allow_value(&quot;12345&quot;).for(:attr), @model
+    end
+    
+    bad_values = [nil, &quot;&quot;, &quot;abc&quot;, &quot;0&quot;, &quot;50001&quot;, &quot;123456&quot;]
+    bad_values.each do |value|
+      should &quot;not allow a bad value (#{value.inspect})&quot; do
+        assert_rejects allow_value(value).for(:attr), @model
+      end
+    end
+  end
+
 end</diff>
      <filename>test/matchers/active_record/allow_value_matcher_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,6 +38,9 @@ class UserTest &lt; ActiveSupport::TestCase
 
   should_not_allow_values_for :email, &quot;blah&quot;, &quot;b lah&quot;
   should_allow_values_for :email, &quot;a@b.com&quot;, &quot;asdf@asdf.com&quot;
+  should_allow_values_for :age, 1, 10, 99
+  should_not_allow_values_for :age, &quot;a&quot;, &quot;-&quot;
+  should_not_allow_values_for :ssn, &quot;a&quot;, 1234567890
   should_ensure_length_in_range :email, 1..100
   should_ensure_value_in_range :age, 1..100, :low_message  =&gt; /greater/,
                                              :high_message =&gt; /less/</diff>
      <filename>test/unit/user_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>af142c6368346f70b3080ea25cef3a48b3908993</id>
    </parent>
  </parents>
  <author>
    <name>matflores</name>
    <email>mflores@atlanware.com</email>
  </author>
  <url>http://github.com/thoughtbot/shoulda/commit/0a0bbcdeb3209af854372539b988b23da696aaff</url>
  <id>0a0bbcdeb3209af854372539b988b23da696aaff</id>
  <committed-date>2009-06-09T17:09:08-07:00</committed-date>
  <authored-date>2009-05-15T06:14:06-07:00</authored-date>
  <message>Changed the behavior of AllowValue matcher so that should_allow_values_for fails if there is ANY error on the specified attribute</message>
  <tree>e2b662a2384235e55d8d46adb4b9e22ac64b9681</tree>
  <committer>
    <name>Joe Ferris</name>
    <email>joe.r.ferris@gmail.com</email>
  </committer>
</commit>
