From 3821caa1375096f33c22ff833796825a91df8dac Mon Sep 17 00:00:00 2001 From: Matheus Sales Date: Wed, 20 Dec 2023 09:33:50 -0300 Subject: [PATCH] chore: Update Rails versions (#1591) * chore: Update Rails versions * fix: Remove composite foreign_key specs This commit removes the specs for composite foreign keys. This is because Rails never supported passing arrays to `foreign_key` modifier and it will raise an error on Rails 7.1.2+. Check the following commit for more information: https://github.com/rails/rails/commit/529d1f55a8138798d92a6f2aba01681315958ab3 --- Appraisals | 6 +- gemfiles/rails_6_1.gemfile | 2 +- gemfiles/rails_6_1.gemfile.lock | 160 +++++++++--------- gemfiles/rails_7_0.gemfile | 2 +- gemfiles/rails_7_0.gemfile.lock | 124 +++++++------- gemfiles/rails_7_1.gemfile | 5 +- gemfiles/rails_7_1.gemfile.lock | 121 ++++++------- .../active_record/association_matcher_spec.rb | 42 ----- 8 files changed, 215 insertions(+), 247 deletions(-) diff --git a/Appraisals b/Appraisals index f24fbf8e5..a625092f5 100644 --- a/Appraisals +++ b/Appraisals @@ -17,7 +17,7 @@ appraise 'rails_6_1' do instance_eval(&shared_spring_dependencies) instance_eval(&controller_test_dependency) - gem 'rails', '6.1.7.2' + gem 'rails', '6.1.7.6' gem 'puma', '~> 5.0' gem 'sass-rails', '>= 6' gem 'turbolinks', '~> 5' @@ -45,7 +45,7 @@ appraise 'rails_7_0' do instance_eval(&shared_spring_dependencies) instance_eval(&controller_test_dependency) - gem 'rails', '7.0.4.2' + gem 'rails', '7.0.8' gem 'sprockets-rails' gem 'puma', '~> 5.0' gem 'importmap-rails' @@ -73,7 +73,7 @@ appraise 'rails_7_1' do instance_eval(&shared_spring_dependencies) instance_eval(&controller_test_dependency) - gem 'rails', '7.1.0' + gem 'rails', '7.1.2' gem 'sprockets-rails' gem 'puma', '~> 6.0' gem 'importmap-rails' diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index 57d236317..066cedf02 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -20,7 +20,7 @@ gem "yard" gem "spring" gem "spring-watcher-listen", "~> 2.0.0" gem "rails-controller-testing", ">= 1.0.1" -gem "rails", "6.1.7.2" +gem "rails", "6.1.7.6" gem "puma", "~> 5.0" gem "sass-rails", ">= 6" gem "turbolinks", "~> 5" diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 3b0174a55..629ea4376 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -1,60 +1,60 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.2) - actionpack (= 6.1.7.2) - activesupport (= 6.1.7.2) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.2) - actionpack (= 6.1.7.2) - activejob (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (>= 2.7.1) - actionmailer (6.1.7.2) - actionpack (= 6.1.7.2) - actionview (= 6.1.7.2) - activejob (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.2) - actionview (= 6.1.7.2) - activesupport (= 6.1.7.2) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.2) - actionpack (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) nokogiri (>= 1.8.5) - actionview (6.1.7.2) - activesupport (= 6.1.7.2) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.2) - activesupport (= 6.1.7.2) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) globalid (>= 0.3.6) - activemodel (6.1.7.2) - activesupport (= 6.1.7.2) - activerecord (6.1.7.2) - activemodel (= 6.1.7.2) - activesupport (= 6.1.7.2) - activestorage (6.1.7.2) - actionpack (= 6.1.7.2) - activejob (= 6.1.7.2) - activerecord (= 6.1.7.2) - activesupport (= 6.1.7.2) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.2) + activesupport (6.1.7.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -72,7 +72,7 @@ GEM msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) - capybara (3.36.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -85,13 +85,13 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.0) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) ffi (1.15.5) fssm (0.2.10) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) i18n (1.12.0) concurrent-ruby (~> 1.0) jbuilder (2.11.5) @@ -101,9 +101,9 @@ GEM listen (3.5.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.19.1) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap @@ -113,10 +113,9 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.1) minitest (5.17.0) msgpack (1.6.0) - net-imap (0.3.4) + net-imap (0.4.8) date net-protocol net-pop (0.1.2) @@ -126,8 +125,9 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.10) - mini_portile2 (~> 2.8.0) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) parallel (1.22.1) parser (3.2.0.0) @@ -149,33 +149,35 @@ GEM rack (>= 1.2.0) rack-test (2.0.2) rack (>= 1.3) - rails (6.1.7.2) - actioncable (= 6.1.7.2) - actionmailbox (= 6.1.7.2) - actionmailer (= 6.1.7.2) - actionpack (= 6.1.7.2) - actiontext (= 6.1.7.2) - actionview (= 6.1.7.2) - activejob (= 6.1.7.2) - activemodel (= 6.1.7.2) - activerecord (= 6.1.7.2) - activestorage (= 6.1.7.2) - activesupport (= 6.1.7.2) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) bundler (>= 1.15.0) - railties (= 6.1.7.2) + railties (= 6.1.7.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (6.1.7.2) - actionpack (= 6.1.7.2) - activesupport (= 6.1.7.2) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) method_source rake (>= 12.2) thor (~> 1.0) @@ -200,14 +202,14 @@ GEM rspec-mocks (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-support (3.12.0) rubocop (1.43.0) json (~> 2.3) @@ -223,7 +225,7 @@ GEM parser (>= 3.1.1.0) rubocop-packaging (0.5.2) rubocop (>= 1.33, < 2.0) - rubocop-rails (2.17.4) + rubocop-rails (2.22.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -255,7 +257,8 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.0-x86_64-linux) + sqlite3 (1.6.9-arm64-darwin) + sqlite3 (1.6.9-x86_64-linux) thor (1.2.1) tilt (2.0.11) timeout (0.3.1) @@ -266,12 +269,12 @@ GEM concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) warnings_logger (0.1.1) - webdrivers (5.2.0) + webdrivers (5.3.1) nokogiri (~> 1.6) rubyzip (>= 1.3.0) - selenium-webdriver (~> 4.0) + selenium-webdriver (~> 4.0, < 4.11) webrick (1.7.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -283,6 +286,7 @@ GEM method_source (>= 0.6.7) PLATFORMS + arm64-darwin-22 x86_64-linux DEPENDENCIES @@ -301,7 +305,7 @@ DEPENDENCIES psych (~> 3.0) puma (~> 5.0) rack-mini-profiler (~> 2.0.0) - rails (= 6.1.7.2) + rails (= 6.1.7.6) rails-controller-testing (>= 1.0.1) rake (= 13.0.1) redcarpet diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index 8730107f5..cf80998d7 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -20,7 +20,7 @@ gem "yard" gem "spring" gem "spring-watcher-listen", "~> 2.0.0" gem "rails-controller-testing", ">= 1.0.1" -gem "rails", "7.0.4.2" +gem "rails", "7.0.8" gem "sprockets-rails" gem "puma", "~> 5.0" gem "importmap-rails" diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 1ea7a4158..d88781263 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -1,67 +1,67 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.2) - actionpack (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.2) - actionview (= 7.0.4.2) - activesupport (= 7.0.4.2) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.2) - actionpack (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.2) - activesupport (= 7.0.4.2) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.4.2) - activesupport (= 7.0.4.2) - activerecord (7.0.4.2) - activemodel (= 7.0.4.2) - activesupport (= 7.0.4.2) - activestorage (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activesupport (= 7.0.4.2) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.2) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -90,7 +90,7 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.0) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) ffi (1.15.5) @@ -123,16 +123,18 @@ GEM mini_mime (1.1.2) minitest (5.17.0) msgpack (1.6.0) - net-imap (0.3.4) + net-imap (0.4.8) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol nio4r (2.5.8) + nokogiri (1.14.1-arm64-darwin) + racc (~> 1.4) nokogiri (1.14.1-x86_64-linux) racc (~> 1.4) parallel (1.22.1) @@ -152,20 +154,20 @@ GEM rack (2.2.6.2) rack-test (2.0.2) rack (>= 1.3) - rails (7.0.4.2) - actioncable (= 7.0.4.2) - actionmailbox (= 7.0.4.2) - actionmailer (= 7.0.4.2) - actionpack (= 7.0.4.2) - actiontext (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activemodel (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.4.2) + railties (= 7.0.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -175,9 +177,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -248,11 +250,12 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + sqlite3 (1.6.0-arm64-darwin) sqlite3 (1.6.0-x86_64-linux) stimulus-rails (1.2.1) railties (>= 6.0.0) thor (1.2.1) - timeout (0.3.1) + timeout (0.4.0) turbo-rails (1.3.2) actionpack (>= 6.0.0) activejob (>= 6.0.0) @@ -267,7 +270,7 @@ GEM selenium-webdriver (~> 4.0) webrick (1.7.0) websocket (1.2.9) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -279,6 +282,7 @@ GEM method_source (>= 0.6.7) PLATFORMS + arm64-darwin-22 x86_64-linux DEPENDENCIES @@ -294,7 +298,7 @@ DEPENDENCIES pry pry-byebug puma (~> 5.0) - rails (= 7.0.4.2) + rails (= 7.0.8) rails-controller-testing (>= 1.0.1) rake (= 13.0.1) redcarpet diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile index 22a183d93..f9b46440e 100644 --- a/gemfiles/rails_7_1.gemfile +++ b/gemfiles/rails_7_1.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "appraisal", "2.4.0" +gem "appraisal", "2.5.0" gem "bundler", "~> 2.0" gem "pry" gem "pry-byebug" @@ -20,7 +20,7 @@ gem "yard" gem "spring" gem "spring-watcher-listen", "~> 2.0.0" gem "rails-controller-testing", ">= 1.0.1" -gem "rails", "7.1.0" +gem "rails", "7.1.2" gem "sprockets-rails" gem "puma", "~> 6.0" gem "importmap-rails" @@ -40,3 +40,4 @@ gem "pg", "~> 1.1" if RUBY_VERSION >= "3.1" && RUBY_VERSION < "3.2" gem "error_highlight", ">= 0.4.0", platforms: [:ruby] end + diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 7cbc7e9f7..aec65bfc2 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -1,70 +1,71 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.0) - actionpack (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activesupport (= 7.1.0) + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.0) - actionview (= 7.1.0) - activesupport (= 7.1.0) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) nokogiri (>= 1.8.5) + racc rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.0) - actionpack (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.0) - activesupport (= 7.1.0) + actionview (7.1.2) + activesupport (= 7.1.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.0) - activesupport (= 7.1.0) + activejob (7.1.2) + activesupport (= 7.1.2) globalid (>= 0.3.6) - activemodel (7.1.0) - activesupport (= 7.1.0) - activerecord (7.1.0) - activemodel (= 7.1.0) - activesupport (= 7.1.0) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) timeout (>= 0.4.0) - activestorage (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activesupport (= 7.1.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) marcel (~> 1.0) - activesupport (7.1.0) + activesupport (7.1.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -76,7 +77,7 @@ GEM tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - appraisal (2.4.0) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) @@ -101,7 +102,7 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) drb (2.1.1) ruby2_keywords @@ -142,12 +143,12 @@ GEM minitest (5.20.0) msgpack (1.7.2) mutex_m (0.1.2) - net-imap (0.4.0) + net-imap (0.4.8) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout net-smtp (0.4.0) net-protocol @@ -181,20 +182,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.0) - actioncable (= 7.1.0) - actionmailbox (= 7.1.0) - actionmailer (= 7.1.0) - actionpack (= 7.1.0) - actiontext (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activemodel (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + rails (7.1.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) bundler (>= 1.15.0) - railties (= 7.1.0) + railties (= 7.1.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -206,9 +207,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -293,7 +294,7 @@ GEM railties (>= 6.0.0) stringio (3.0.8) thor (1.2.2) - timeout (0.4.0) + timeout (0.4.1) turbo-rails (1.4.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) @@ -323,7 +324,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - appraisal (= 2.4.0) + appraisal (= 2.5.0) bcrypt (~> 3.1.7) bootsnap bundler (~> 2.0) @@ -335,7 +336,7 @@ DEPENDENCIES pry pry-byebug puma (~> 6.0) - rails (= 7.1.0) + rails (= 7.1.2) rails-controller-testing (>= 1.0.1) rake (= 13.0.1) redcarpet diff --git a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb index 8fac61732..5b8df5646 100644 --- a/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb @@ -1335,48 +1335,6 @@ def having_many_non_existent_class(model_name, assoc_name, options = {}) and_fail_with(expected_message) end - it 'rejects an association with a valid :class_name and a bad :foreign_key option (CPK)' do - define_model :person_detail - define_model :person do - has_one :detail, class_name: 'PersonDetail', foreign_key: %i[company_id person_detail_id] - end - - expected_message = 'Expected Person to have a has_one association called detail ' \ - '(PersonDetail does not have a [:foo_id, :bar_id] foreign key.)' - - expect do - have_one(:detail).class_name('PersonDetail'). - with_foreign_key(%i[foo_id bar_id]) - end.not_to match_against(Person.new).and_fail_with(expected_message) - end - - it 'rejects an association with a valid :class_name and :foreign_key option (CPK), but no columns' do - define_model :person_detail - define_model :person do - has_one :detail, class_name: 'PersonDetail', foreign_key: %i[company_id person_detail_id] - end - - expected_message = 'Expected Person to have a has_one association called detail ' \ - '(PersonDetail does not have a [:company_id, :person_detail_id] foreign key.)' - - expect do - have_one(:detail).class_name('PersonDetail'). - with_foreign_key(%i[company_id person_detail_id]) - end.not_to match_against(Person.new).and_fail_with(expected_message) - end - - it 'accepts an association with a valid :class_name and :foreign_key option (CPK)' do - define_model :person_detail, company_id: :integer, person_detail_id: :integer - define_model :person do - has_one :detail, class_name: 'PersonDetail', foreign_key: %i[company_id person_detail_id] - end - - expect(Person.new). - to have_one(:detail). - class_name('PersonDetail'). - with_foreign_key(%i[company_id person_detail_id]) - end - it 'adds error message when rejecting an association with non-existent class' do message = 'Expected Person to have a has_one association called detail (Detail2 does not exist)' expect {