File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
spec/unit/shoulda/matchers/active_record Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 33describe Shoulda ::Matchers ::ActiveRecord ::AssociationMatcher , type : :model do
44 include UnitTests ::ApplicationConfigurationHelpers
55
6- if rails_version <= 8.1
7- context 'using the deprecated matcher' do
8- it 'raises a NotImplementedError' do
9- message = '`deprecated` association matcher is only available on Active Record >= 8.1.'
10-
11- expect do
12- expect ( having_many_children ( deprecated : false ) ) . to have_many ( :children ) . deprecated ( false )
13- end . to fail_with_message ( message )
14- end
15- end
16- end
17-
186 context 'belong_to' do
197 it 'accepts a good association with the default foreign key' do
208 expect ( belonging_to_parent ) . to belong_to ( :parent )
@@ -807,6 +795,18 @@ def ensure_parent_is_set
807795 end
808796 end
809797
798+ if rails_version <= 8.1
799+ context 'using the deprecated matcher' do
800+ it 'raises a NotImplementedError' do
801+ message = '`deprecated` association matcher is only available on Active Record >= 8.1.'
802+
803+ expect do
804+ expect ( having_many_children ( deprecated : false ) ) . to have_many ( :children ) . deprecated ( false )
805+ end . to fail_with_message ( message )
806+ end
807+ end
808+ end
809+
810810 def belonging_to_parent ( options = { } , parent_options = { } , &block )
811811 child_model = create_child_model_belonging_to_parent (
812812 options ,
You can’t perform that action at this time.
0 commit comments