Simple one-liner tests for common Rails functionality
MIT License
Bot releases are visible (Hide)
default
qualifier to define_enum_for
matcher by @matsales28 (#1627)logger
require by @Earlopain (#1634)Published by matsales28 7 months ago
against
method in allow_value matcher by @EduardoSCosta (#1543)strict_loading
option in association matchers by @rhannequin and @laicuRoot (#1607)have_delegated_type
matcher by @matsales28 (#1606)foreign_type
qualifier on AssociationMatcher
by @matsales28 (#1609)ActionController
and Routing
matchers for ActionController::TestCase
by @ilianah (#1613)is_greater_than
in validate_comparison_of
matcher by @jeduardo824 (#1616)Published by matsales28 9 months ago
validate_numericality
matcher by @matsales28 (#1603)encrypt
matcher to test usage of the encrypts
macro by @theforestvn88 (#1581)query_constraints
qualifier on the association matchers by @matsales28 (#1604)array_column?
helper from ValidateAbsenceOfMatcher
by @jarenas9539 (#1562)REPRODUCTION_SCRIPT.md
link returning 404 by @VSPPedro (#1602)Published by matsales28 10 months ago
Thanks everyone for the contributions!
Published by VSPPedro almost 2 years ago
Published by VSPPedro about 2 years ago
Add without_scopes method to enum matcher. (https://github.com/thoughtbot/shoulda-matchers/pull/1453)
Add support for Ruby 3.1. (https://github.com/thoughtbot/shoulda-matchers/pull/1474)
Add allow_blank method to validate_presence_of matcher. (https://github.com/thoughtbot/shoulda-matchers/pull/1499)
Add support for Rails 7.0. No new Rails 7.0 features are supported, but only existing features that broke with the upgrade. (https://github.com/thoughtbot/shoulda-matchers/pull/1506)
Thanks @technicalpickles, @dewyze, @andreLumor for your contributions!
Published by VSPPedro almost 3 years ago
in?
, method from ActiveSupport, with include?
to prevent exception "undefined method in?
" on non-Rails app. (#1405)Add support for Rails 6.1. No new Rails 6.1 features are supported, but only existing features that broke with the upgrade. (#1418)
Add support for RVM (Ruby Version Manager) to setting up local environment. (#1424)
Add support for alias in matcher define_enum. (#1419)
Drop support for Rails 4.2, 5.0 and 5.1 as well as Ruby 2.4 and 2.5
they've been end-of-lifed. The gem now supports Ruby 2.6+ and Rails 5.2+. (#1412, #1415, #1422, #1428, #1429)
Remove deprecated matchers: use_before_filter
, use_after_filter
, use_around_filter
and allow_mass_assignment_of
. (#1430, #1431)
in?
, method from ActiveSupport, with include?
to prevent exception "undefined method in?
" on non-Rails app. (#1405)Add support for Rails 6.1. No new Rails 6.1 features are supported, but only
existing features that broke with the upgrade. (#1418)
Add support for RVM (Ruby Version Manager) to setting up local environment. (#1424)
Add support for alias in matcher define_enum. (#1419)
Drop support for Rails 4.2, 5.0 and 5.1 as well as Ruby 2.4 and 2.5
they've been end-of-lifed. The gem now supports Ruby 2.6+ and Rails 5.2+.(#1412, #1415, #1422, #1428, #1429)
Remove deprecated matchers: use_before_filter
, use_after_filter
, use_around_filter
and allow_mass_assignment_of
. (#1430, #1431)
belongs_to
to work with composite primary keys. (#1396)bundle exec yard doc
replacing pygments.rb with rouge to keep the documentation up to date. (#1343)git ls-files
in gemspec to help downstreams maintenance, because they often need to build packages in an environment that does not have git. (#1354)Published by mcmire about 4 years ago
Add an ignoring_check_for_db_index
qualifier to the have_secure_token
matcher, since has_secure_token
encourages use of an index but does not
enforce it. (#1278)
Add allow_blank
to validate_length_of
to match other validation matchers.
(#725, #1318)
Add new matcher have_implicit_order_column
which can be used to test the
implicit_order_column
setting for ActiveRecord models under Rails 6+.
(#1243)
Add a new is_other_than
qualifier to validate_numericality_of
to be able
to test the numericality validation's :other_than
option. (#1282)
Add a new have_one_attached
and have_many_attached
matchers for testing
the new model-level ActiveStorage macros in Rails 6. (#1102)
Fix performance of allow_value
so that it doesn't hang if the given value is
really long. (#1290)
Fix have_many
so that it is possible to test an association that has a scope
that takes an argument. (#952, #992)
Update validate_uniqueness_of
to use the public validators_on
instead of
the private _validators
when reading validations off of a model. This
enables shoulda-matchers to be used with the schema_validations gem.
(#995)
Update validate_uniqueness_of
to work with scopes that are time
columns.
(#1190)
Fix have_and_belong_to_many
so that when using the join_table
qualifier
you can pass a symbol rather than a string. (#1323)
Update have_many
when used against a :through
association so that it fails
if the inverse model does not have a belongs_to
association. (#646,
#723, c0a1578)
Add Ruby 2.7 to test matrix and default development Ruby. (#1310)
Remove warnings emitted on Ruby 2.7 in word_wrap
. (#1314)
Remove warnings emitted on Ruby 2.7 in Doublespeak. (#1328)
Clean up requires within the code by converting them to autoload
s. (#1320)
Published by guialbuk almost 5 years ago
optional: false
in belongs_to
associations. (#1237)inverse_of: false
and non-standard foreign key (#1106)allow_values
(#1241)minitest-reporters
dependency ([#1251])Published by mcmire over 5 years ago
validate_presence_of
that werePublished by mcmire over 5 years ago
validate_uniqueness_of
so that it works when a scope is defined as ahave_db_index
so that it can be used against multiple models that arehave_db_index
. (#1211)allow_nil
to the validate_presence_of
matcher. (834d8d0, #1100)validate_presence_of
so that if it is being used against anrequired: true
or optional: false
, or it is notbelong_to
associations tooptional: false
, and the matcher fails, the developer is reminded in thebelong_to
matcher can be used instead. (#1214,define_enum_for
so that it produces a more helpful message onPublished by mcmire over 5 years ago
Fix gemspec so that setup
script isn't installed globally when gem is installed.
Published by guialbuk over 5 years ago
Published by guialbuk about 6 years ago
Adds support for Ruby 2.4 and 2.5 and Rails 5.x.
Drops support for Ruby 2.0 and 2.1 as well as Rails 4.0 and 4.1.
Published by guialbuk over 7 years ago
When the permit
matcher was used without #on
, the controller did not use
params#require
, the params object was duplicated, and the matcher did not
recognize the #permit
call inside the controller. This behavior happened
because the matcher overwrote double registries with the same parameter hash
whenever ActionController::Parameters was instantiated.