spec/unit/associations_spec.rb in mongoid-rspec-4.0.0 vs spec/unit/associations_spec.rb in mongoid-rspec-4.0.1
- old
+ new
@@ -37,10 +37,12 @@
describe Permalink do
it { is_expected.to be_embedded_in(:linkable).as_inverse_of(:link) }
end
describe Site do
- if Mongoid::Compatibility::Version.mongoid6_or_newer?
+ if Mongoid::Compatibility::Version.mongoid6?
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
end