Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade shoulda-matchers to version 4.0.0 #1542

Merged
merged 1 commit into from
Feb 17, 2019

Conversation

depfu[bot]
Copy link
Contributor

@depfu depfu bot commented Feb 17, 2019

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ shoulda-matchers (~> 3.1 → ~> 4.0) · Repo · Changelog

Release Notes

4.0.0 (from changelog)

This release mainly brings the gem up to date with modern versions of Ruby and Rails and drops support for older, unsupported versions. The compatibility list is now:

  • Ruby: 2.6.0, 2.5.1, 2.4.4, 2.3.7
  • Rails: 5.2.2, 5.1.6.1, 5.0.7, 4.2.10

Backward-incompatible changes

  • Drop support for Rails 4.0 and 4.1 as well as Ruby 2.0, 2.1, and 2.2, since they've been end-of-lifed. The gem now supports Ruby 2.3+ and Rails 4.2+.

  • use_before_filter, use_after_filter, and use_around_filter are no longer usable when using shoulda-matchers under Rails 5.x, as the corresponding controller callbacks don't exist there.

Deprecations

  • define_enum_for: with is deprecated in favor of with_values. This is to prevent confusion with with_prefix and with_suffix, which are new.

Bug fixes

  • Fix association matchers when used under Rails 5.x so that they make use of ActiveRecord::Base.connection.data_sources instead of ActiveRecord::Base.connection.tables, which was deprecated.

  • Fix the serialize matcher so that it works with Rails 5.x.

  • Fix our custom mocking library Doublespeak, which is used by delegate_method, so that it does not produce a warning under Ruby 2.4.

  • Fix the permit matcher so that it uses the correct method signature to call the controller action with params in order to prevent a warning under Rails 5.x.

  • Fix the define_enum_for matcher so that it once more allows string columns to be used as enum attributes.

  • Fix validate_uniqueness_of when used under Rails 4.2 so that when the attribute you're testing is a boolean column, it will no longer emit a warning.

  • Fix validate_inclusion_of so that if it fails, it will no longer blow up with the error "undefined method `attribute_setter' for nil:NilClass".

    • Original issue: #904
  • Add negative versions of all validation matchers (i.e. implement does_not_match? for them) to prevent them from blowing up with "undefined method `attribute_setter' for nil:NilClass".

    • Original issue: #904

Features

  • Add required and optional qualifiers to belong_to and have_one matchers. (When using the belong_to matcher under Rails 5+, required is assumed unless overridden.)

  • Add without_presence_validation qualifier to belong_to to get around the fact that required is assumed, above.

  • Add allow_nil qualifier to delegate_method.

  • Add allow_nil qualifier to validate_length_of.

  • Add a port option to the route matcher to allow testing a route that has a constraint on it such that only a specific port may be used to access that route.

  • Add with_prefix and with_suffix to define_enum_for to allow testing the enum macro with corresponding prefix and suffix options (Rails 5 only).

  • Add index_errors option to has_many (Rails 5 only).

Improvements

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Feb 17, 2019
@codeclimate
Copy link

codeclimate bot commented Feb 17, 2019

Code Climate has analyzed commit edb582c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 91.3% (0.0% change).

View more on Code Climate.

@tvdeyen tvdeyen merged commit 088550d into master Feb 17, 2019
@depfu depfu bot deleted the depfu/update/shoulda-matchers-4.0.0 branch February 17, 2019 16:58
tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this pull request Mar 29, 2019
- Use element name local in generators [AlchemyCMS#1556](AlchemyCMS#1556) ([tvdeyen](https://github.com/tvdeyen))
- Remove invalid bytecode handler [AlchemyCMS#1555](AlchemyCMS#1555) ([tvdeyen](https://github.com/tvdeyen))
- Separate render element calls [AlchemyCMS#1554](AlchemyCMS#1554) ([tvdeyen](https://github.com/tvdeyen))
- Expose the element into partials as local object [AlchemyCMS#1553](AlchemyCMS#1553) ([tvdeyen](https://github.com/tvdeyen))
- Allow admins to switch all languages [AlchemyCMS#1552](AlchemyCMS#1552) ([tvdeyen](https://github.com/tvdeyen))
- Raise targeted Ruby version to 2.3 [AlchemyCMS#1545](AlchemyCMS#1545) ([tvdeyen](https://github.com/tvdeyen))
- Introduces an Elements finder class [AlchemyCMS#1544](AlchemyCMS#1544) ([tvdeyen](https://github.com/tvdeyen))
- Fixate sqlite dep for bug fix [AlchemyCMS#1543](AlchemyCMS#1543) ([tvdeyen](https://github.com/tvdeyen))
- Upgrade shoulda-matchers to version 4.0.0 [AlchemyCMS#1542](AlchemyCMS#1542) ([depfu](https://github.com/apps/depfu))
- Upgrade factory_bot_rails to version 5.0.1 [AlchemyCMS#1540](AlchemyCMS#1540) ([depfu](https://github.com/apps/depfu))
- Use Flatpickr as Datepicker [AlchemyCMS#1533](AlchemyCMS#1533) ([mamhoff](https://github.com/mamhoff))
-  Use system tests over feature specs [AlchemyCMS#1528](AlchemyCMS#1528) ([tvdeyen](https://github.com/tvdeyen))
- Flexible width for admin navigation entry labels [AlchemyCMS#1527](AlchemyCMS#1527) ([tvdeyen](https://github.com/tvdeyen))
- Responsive elements window and sidebar [AlchemyCMS#1519](AlchemyCMS#1519) ([tvdeyen](https://github.com/tvdeyen))
- Change element eye icon on public state [AlchemyCMS#1517](AlchemyCMS#1517) ([oniram88](https://github.com/oniram88))
- Maximize element window if Tinymce is fullscreen [AlchemyCMS#1515](AlchemyCMS#1515) ([tvdeyen](https://github.com/tvdeyen))
- Remove cells in favour of fixed elements [AlchemyCMS#1514](AlchemyCMS#1514) ([tvdeyen](https://github.com/tvdeyen))
- Feature: Autogenerate nestable elements [AlchemyCMS#1513](AlchemyCMS#1513) ([tvdeyen](https://github.com/tvdeyen))
- Allow "data" key for module navigations [AlchemyCMS#1512](AlchemyCMS#1512) ([mamhoff](https://github.com/mamhoff))
- Allow to define layout for page previews [AlchemyCMS#1500](AlchemyCMS#1500) ([westonganger](https://github.com/westonganger))
- Fix capitalization for login/logout/leave [AlchemyCMS#1497](AlchemyCMS#1497) ([westonganger](https://github.com/westonganger))
- Verify controller keys within `register_module` [AlchemyCMS#1495](AlchemyCMS#1495) ([westonganger](https://github.com/westonganger))
- Update bundled Tinymce to 4.8.3 [AlchemyCMS#1491](AlchemyCMS#1491) ([tvdeyen](https://github.com/tvdeyen))
- Use dynamic attributes in factories [AlchemyCMS#1484](AlchemyCMS#1484) ([tvdeyen](https://github.com/tvdeyen))
- Migrating to active_model_serializers ~> 0.10.0 [AlchemyCMS#1478](AlchemyCMS#1478) ([pmashchak](https://github.com/pmashchak))
- Replace picture galleries with nestable elements [AlchemyCMS#1358](AlchemyCMS#1358) ([tvdeyen](https://github.com/tvdeyen))
- Add a compact nested element style [AlchemyCMS#1357](AlchemyCMS#1357) by [tvdeyen](https://github.com/tvdeyen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant