File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
lib/shoulda/matchers/active_record
spec/unit/shoulda/matchers/active_record Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1012,7 +1012,7 @@ def have_delegated_type(name)
10121012 # ##### deprecated
10131013 #
10141014 # Use `deprecated` to assert that the `:deprecated` option was specified.
1015- # (Rails 8.1+).
1015+ # (Enabled by default in Rails 8.1+)
10161016 #
10171017 # class Player < ActiveRecord::Base
10181018 # has_many :games, deprecated: true
@@ -1643,11 +1643,11 @@ def join_table(join_table_name)
16431643 end
16441644
16451645 def deprecated ( deprecated = true )
1646- if Rails ::VERSION ::STRING >= '8.1'
1646+ if :: ActiveRecord ::VERSION ::STRING >= '8.1'
16471647 @options [ :deprecated ] = deprecated
16481648 self
16491649 else
1650- raise NotImplementedError , "`deprecated` association matcher is only available on Rails version >= 8.1."
1650+ raise NotImplementedError , "`deprecated` association matcher is only available on Active Record >= 8.1."
16511651 end
16521652 end
16531653
Original file line number Diff line number Diff line change 66 if rails_version <= 8.1
77 context "using the deprecated matcher" do
88 it 'raises a NotImplementedError' do
9+ message = "`deprecated` association matcher is only available on Active Record >= 8.1."
10+
911 expect do
1012 expect ( having_many_children ( deprecated : false ) ) . to have_many ( :children ) . deprecated ( false )
11- end . to fail_with_message ( "hello" )
13+ end . to fail_with_message ( message )
1214 end
1315 end
1416 end
You can’t perform that action at this time.
0 commit comments