Commit Graph

10 Commits

Author SHA1 Message Date
Elliot Winkler a21426c2d6 Raise CouldNotSetPasswordError more safely
It seems that adding a restriction to allow_value to raise
CouldNotClearAttribute if nil cannot be set on the attribute in question
broke a lot of people's tests. Really the only reason we added this was
for validate_presence_of -- it rescued CouldNotClearAttribute and
re-raised it as CouldNotSetPasswordError, but only for passwords and
only if has_secure_password was being used. So, I've figured out another
way of performing this check inside of validate_presence_of only to
prevent tests that have nothing to do with from breaking unnecessarily.
2014-04-16 12:17:58 -06:00
Yukio Mizuta 806716c79c Improve ValidateNumericalityOfMatcher document expression 2014-01-31 09:47:50 -07:00
Christopher Chow 1878e89a13 Update deprecated matcher protocol for RSpec 3.
The methods failure_message_for_should and failure_message_for_should_not
have been updated to failure_message and failure_message_negated respectively.
Alias to the old methods to remain backwards compatibility with RSpec 2.
2013-12-24 22:34:26 +11:00
Elliot Winkler a026afb800 Fix validates_confirmation_of matcher so that it works under Rails 4
Rails 4 changed how validates_confirmation_of works so that the error
message is applied to the confirmation attribute, not the original
attribute.
2013-08-16 16:17:26 -06:00
Samuel Cochran e40f778515 Fix context support for disallowed value and validation matchers 2013-07-02 12:18:56 +10:00
Melissa Xie 058f39f187 Use DisallowValueMatcher for `disallows_value_of` method 2013-03-28 14:02:03 -04:00
Brian Shaver 4f8684c6db Rename failure_message and negative_failure_message
* fixes #108 : RSpec 2.10 compatibility
* remove unnecessary attr_readr
2013-03-08 14:49:12 -05:00
Gabe Berke-Williams af8f9a7bff Use current thoughtbot style in specs 2012-12-26 22:45:54 -05:00
Reade Harris 8a563c18a5 Improve error message handling in ValidateNumericalityOfMatcher and OnlyIntegerMatcher. 2012-11-09 09:35:20 -05:00
Reade Harris 6ba8c9f1a1 Use submatchers instead of inheritance for ValidatesNumericalityMatcher. 2012-11-09 09:35:20 -05:00