spec/unit/associations_spec.rb in mongoid-rspec-4.0.1 vs spec/unit/associations_spec.rb in mongoid-rspec-4.1.0

- old
+ new

@@ -37,12 +37,18 @@ describe Permalink do it { is_expected.to be_embedded_in(:linkable).as_inverse_of(:link) } end describe Site do - if Mongoid::Compatibility::Version.mongoid6? + if Mongoid::Compatibility::Version.mongoid6_or_older? it { is_expected.to have_many(:users).as_inverse_of(:site).ordered_by(:email.desc).with_counter_cache } elsif Mongoid::Compatibility::Version.mongoid7_or_newer? it { is_expected.to have_many(:users).as_inverse_of(:site).ordered_by(:email.desc) } + end + end + + describe Message do + if Mongoid::Compatibility::Version.mongoid6_or_newer? + it { is_expected.to belong_to(:user).with_optional } end end end