Commit Graph

14 Commits

Author SHA1 Message Date
Gabe Berke-Williams ba78ed0ff8 Cleanup. 2012-03-23 10:48:43 -04:00
Frank Luithle cab62a1697 allow multiple values for AllowValueMatcher
With the deprecation of "should_allow_values_for" there is currently no clean
way to specify multiple allowed (or forbidden) values for an attribute in a
single assertion. This can make test cases unnecessarily verbose.

This patch gives AllowValueMatcher the ability to take multiple values. The new
matcher is fully downward compatible (i.e. given a single argument it behaves
identically to the old matcher).

This matcher will stop checking for bad values when the first bad value is
encountered.
2012-03-23 09:53:08 -04:00
Frank Luithle c86d8e2e0c remove a redundancy inside AllowValueMatcher 2012-03-23 09:49:50 -04:00
Frank Luithle 026927b324 optimize AllowValueMatcher slightly 2012-03-23 09:49:50 -04:00
Mike Burns bf937c966f Merge branch 'patch-1' of https://github.com/mergulhao/shoulda-matchers 2012-03-02 09:33:39 -05:00
Sylvestre Mergulhao 3a75c6877c Fix typo on allow_mass_assignment_of_matcher documentation. 2011-12-21 14:54:12 -02:00
Blake Thomson 1b5fc27cf8 Add validates_confirmation_of matcher 2011-12-15 11:42:26 -05:00
Clemens Helm 662b674cf4 Implemented all possible i18n error messages for validations. 2011-11-17 11:57:57 +01:00
Vasiliy Ermolovich d8308ec74d add ensure_exclusion_of 2011-10-16 20:49:58 +03:00
Steve Madsen 29a1fc6d06 Use to_s.next as the fall back.
Per Joshua Clayton's suggestion (9d0c74e4bf (commitcomment-600085)).
2011-09-20 11:15:03 -04:00
Steve Madsen 9d0c74e4bf Fallback when previous_value doesn't respond to #next.
For example, floating point attributes won't respond to #next, so in
this case fall back to adding 1. This is not perfect, but it seems
to rarely occur in practice since I wasn't able to find anyone else
complaining about it.
2011-09-20 10:51:57 -04:00
Wojciech Wnętrzak 9347fe8009 added role option to mass assigment matcher for rails 3.1 2011-06-03 17:21:05 +02:00
Wojciech Wnętrzak a463849d6b fixed mass assigment matcher for empty attr_accessible declaration, which should protect all attributes 2011-06-03 12:34:05 +02:00
Markus Schwed 2a54fdb28d Seperate ActiveRecord and ActiveModel related matchers 2011-05-06 15:56:36 +02:00