{"push_id":576275525,"size":1,"distinct_size":1,"ref":"refs/heads/ew-raise-if-allow-value-does-not-hold","head":"a678e77231f3c6530103c99adb9a03d671d5882d","before":"ce8fc4694360c78c3f6ca4d29b7ca6a2d28b6cf5","commits":[{"sha":"a678e77231f3c6530103c99adb9a03d671d5882d","author":{"email":"4978aa66a7291e979a38f3b30da82a328129666c@gmail.com","name":"Elliot Winkler"},"message":"allow_value: Raise error if attr sets value differently\n\n`allow_value` will now raise a CouldNotSetAttribute error if the\nattribute in question cannot be changed from a non-nil value to a nil\nvalue, or vice versa. In other words, these are the exact cases in which\nthe error will occur:\n\n* If you're testing whether the attribute allows `nil`, but the\n  attribute detects and ignores nil. (For instance, you have a model\n  that `has_secure_password`. This will add a #password= method to your\n  model that is defined in a such a way that you cannot clear the\n  password by setting it to nil -- nothing happens.)\n* If you're testing whether the attribute allows a non-nil value, but\n  the attribute fails to set that value. (For instance, you have an\n  ActiveRecord model. If ActiveRecord cannot typecast the value in the\n  context of the column, then it will do nothing, and the attribute will be\n  effectively set to nil.)\n\nWhat's the reasoning behind this change? Simply put, if you are assuming\nthat the attribute is changing but in fact it is not, then the test\nyou're writing isn't the test that actually gets run. We feel that this\nis dishonest and produces an invalid test.","distinct":true,"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/commits/a678e77231f3c6530103c99adb9a03d671d5882d"}]}