Shoulda Matchers Versions Save

Simple one-liner tests for common Rails functionality

v6.2.0

2 months ago

6.2.0 - 2024-03-15

Bug fixes

  • Allow beginless and endless ranges in validates_inclusion_of by @pjpires (#1615)
  • Ensure uniqueness validation matcher works with STI by @matsales28 (#1610)

Features

  • Add against method in allow_value matcher by @EduardoSCosta (#1543)
  • Add support for strict_loading option in association matchers by @rhannequin and @laicuRoot (#1607)
  • Add have_delegated_type matcher by @matsales28 (#1606)
  • Add support for foreign_type qualifier on AssociationMatcher by @matsales28 (#1609)

Improvements

  • Lazy load ActionController and Routing matchers for ActionController::TestCase by @ilianah (#1613)
  • Call dynamic-readme reusable workflow by @stefannibrasil (#1617)
  • Update dependencies by @matsales28 (#1611)
  • Fix inline documentation for is_greater_than in validate_comparison_of matcher by @jeduardo824 (#1616)
  • Fix forgotten colon in documentation by @hotoolong (#1612)

v6.1.0

3 months ago

6.1.0 - 2024-01-19

Bug fixes

  • Fix negative form of validate_numericality matcher by @matsales28 (#1603)

Features

  • Add support for negated matcher on have_secure_password matcher by @amalrik (#1593)
  • Add encrypt matcher to test usage of the encrypts macro by @theforestvn88 (#1581)
  • Add query_constraints qualifier on the association matchers by @matsales28 (#1604)

Improvements

  • Remove array_column? helper from ValidateAbsenceOfMatcher by @jarenas9539 (#1562)
  • Bump rubocop version to 1.59.0 by @VSPPedro (#1600)
  • Update Ruby version to 3.3.0 by @VSSPedro(#1599)
  • Fix REPRODUCTION_SCRIPT.md link returning 404 by @VSPPedro (#1602)
  • Add support for globally enabled frozen-string-literals by @amalrik (#1598)
  • Adjust typos in the documentation by @matsales28 (#1597)

v6.0.0

4 months ago

Backward-incompatible changes

  • Drop support for Rails 5.2 and 6.0 as well as Ruby 2.6 and 2.7 they've been end-of-lifed by @dougmrqs and @HeitorMC. The gem now supports Ruby 3.0+ and Rails 6.1+. (#1521, #1522, #1547, #1548)

Bug fixes

  • Fix validate_uniqueness_of matcher not supporting column of the type timestampz by @callahat. (#1544)
  • Ensure that validation specs work for ActiveModel without ActiveRecord by @stonefield. (#1580)

Features

  • Add normalize matcher by @stephannv. (#1558)
  • Add validates_comparison_of matcher by @matsales28. (#1552)
  • Add support for Ruby 3.2 by @petergoldstein. (#1536)
  • Add support for Ruby 3.3.0-rc1 by @mtasaka and @VSPPedro. ([#1579], #1588)
  • Add support for Rails 7.1 by @matsales28. (#1573)
  • Add support for array attributes on validate_length_of matcher by @jarenas9539. #1560
  • Allow length validation on associations by @matsales28. (#1569)
  • Improve have_db_index to better handle columns with multiple indexes by @abrom. (#1542)
  • Implement of_sql_type qualifier on have_db_column matcher by @matsales28. (#1555)

Improvements

  • When an unrelated error is seen with negated allow_value, give a hint by @matsales28. (#1570)

Thanks everyone for the contributions!

v5.3.0

1 year ago

Features

  • Add in: range matcher to validate_numericality_of by @matsales28 . (#1512)

  • Support :uuid column type for validate_absence_of matcher by @dlupu. (#1518)

Bug fixes

  • Fix confusing error message from validate_inclusion_of matcher when used against a polymorphic association. (#1523)

v5.2.0

1 year ago

Features

Thanks @technicalpickles, @dewyze, @andreLumor for your contributions!

v5.1.0

2 years ago

Bug fixes

  • Fix the undefined method error for non rails project due to use of many? - method from ActiveSupport. (#1459)

Features

  • Add array option support for have db column matcher. (#1465)

  • Add enum attributes support for validate_absence_of matcher. (#1464)

v5.0.0

2 years ago

Bug fixes

  • Replace in?, method from ActiveSupport, with include? to prevent exception "undefined method in?" on non-Rails app. (#1405)

Features

  • 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)

  • Add support for Ruby 3.0. (#1406, #1427)

Improvements

  • Remove deprecated warnings emitted on Rails 6.1 in ActiveModel errors. (#1444)

Backward-incompatible changes

  • 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)

v5.0.0.rc1

2 years ago

Bug fixes

  • Replace in?, method from ActiveSupport, with include? to prevent exception "undefined method in?" on non-Rails app. (#1405)

Features

  • 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)

  • Add support for Ruby 3.0. (#1406, #1427)

Backward-incompatible changes

  • 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)

v4.5.1

3 years ago

Bug fixes

  • Update belongs_to to work with composite primary keys. (#1396)

v4.5.0

3 years ago

Features

  • Add support for has_secure_password custom attributes. (#1356)

Bug fixes

  • Fix bundle exec yard doc replacing pygments.rb with rouge to keep the documentation up to date. (#1343)
  • Fix have_db_column.with_options not raising an error when the user adds an invalid value. (#1358)
  • Fix default value of assossiation_matcher.validate option. It was returning false instead of true. (#1378)
  • Fix validate_absence_of failing for array columns. (#1383)

Improvements

  • Replace all links with http to https. (#1340)
  • Update the links for have_and_belong_to_many, have_many and have_one in the README to redirect the user to where the matcher description starts. (#1348)
  • Drop 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)
  • Add comment about no support of validate_uniqueness_of(:item).scoped_to(array). (#1355)
  • Improve error message for assossiation_matcher.with_foreign_key option. (#1376)