Making tests easy on the fingers and eyes
Critical or Security advisories for 2.8.0
This version doesn't have any advisory. Want to report one?
Changelog for 2.8.0
ensure_length_ofhas been renamed to
ensure_length_ofis deprecated and will be removed in 3.0.0.
set_the_flashhas been renamed to
set_the_flashis deprecated and will be removed in 3.0.0.
set_session(:foo)is deprecated in favor of
set_session(:foo)will be invalid syntax in 3.0.0.
should set_session[:key].to(nil)to assert that that a value has not been set is deprecated. Please use
should_not set_session[:key]instead. In 3.0.0,
should set_session[:key].to(nil)will only pass if the value is truly nil.
delegate_methodso that it works again with shoulda-context. (#591)
validate_uniqueness_ofwhen used with
scoped_toso that when one of the scope attributes is a polymorphic
*_typeattribute and the model has another validation on the same attribute, the matcher does not fail with an error. (#592)
throughso that when the association does not exist, and the matcher fails, it does not raise an error when producing the failure message. (#588)
join_tableso that it does not fail when
association_foreign_keywas specified on the association as a symbol instead of a string. (#584)
allow_valuewhen an i18n translation key is passed to
:againstoption is used to specify an alternate attribute. A bug here also happened to affect
validate_confirmation_ofwhen an i18n translation key is passed to
class_namequalifier for association matchers so that if the model being referenced is namespaced, the matcher will correctly resolve the class before checking it against the association's
with_messageso that it fails if given a message that does not match the message on the validation. (#598)
routematcher so that when controller and action are specified in hash notation (e.g.
posts#show), route parameters such as
iddo not need to be specified as a string but may be specified as a number as well. (#602)
validate_inclusion_ofso that they handle RangeErrors emitted from ActiveRecord 4.2. These exceptions arise whenever we attempt to set an attribute using a value that lies outside the range of the column (assuming the column is an integer). RangeError is now treated specially, failing the test instead of bubbling up as an error. (#634, #637, #642)
Add ability to test
:primary_keyoption on associations. (#597)
validate_uniqueness_ofto complement the
set_sessionso that # and #to qualifiers are optional, similar to
set_flash. That is, you can now say
should set_sessionto assert that any flash value has been set, or
should set_session.to('value')to assert that any value in the session is 'value'.
set_sessionso that its #to qualifier supports regexps, similar to
delegate_methodto correspond to the
prefixoption for Rails's
Add support for Rails 4.2, especially fixing
serializematcher to remove warning about
serialized_attributesbeing deprecated. (#627)
dependentqualifier on association matchers to support
:restrict_with_error. You can also pass
falseto assert that the association has (or has not) been declared with any dependent option. (#631)
allow_valuefailure message so that it reads a bit nicer when listing existing errors.
Dependencies for 2.8.0
My projects using shoulda-matchers
|You should be logged in to see which of your projects use shoulda-matchers.|