spec/mongoid/contextual/atomic_spec.rb in mongoid-7.1.1 vs spec/mongoid/contextual/atomic_spec.rb in mongoid-7.1.2

- old
+ new

@@ -75,11 +75,12 @@ it "adds to non initialized fields" do expect(smiths.reload.members).to eq([ "Dave" ]) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let(:criteria) do Band.where(members: [ "DAVE" ]).collation(locale: 'en_US', strength: 2) end @@ -171,11 +172,12 @@ it "adds to non initialized fields" do expect(smiths.reload.members).to eq([ "Dave", "Joe" ]) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let(:criteria) do Band.where(members: [ "DAVE" ]).collation(locale: 'en_US', strength: 2) end @@ -242,11 +244,12 @@ it "performs the bitwise operation on initialized fields" do expect(depeche_mode.reload.likes).to eq(14) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ], likes: 60) end @@ -321,11 +324,12 @@ it "incs the value and read from field" do expect(beatles.reload.y).to eq(3) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -393,11 +397,12 @@ it "does not error on uninitialized fields" do expect(smiths.reload.members).to be_nil end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -447,11 +452,12 @@ it "does not error on non existent fields" do expect(smiths.reload.members).to be_nil end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -504,11 +510,12 @@ it "does not error on non existent fields" do expect(smiths.reload.members).to be_nil end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave", "Alan", "Fletch" ]) end @@ -561,11 +568,12 @@ it "pushes to non existent fields" do expect(smiths.reload.members).to eq([ "Alan" ]) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -626,11 +634,12 @@ it "pushes to non existent fields" do expect(smiths.reload.members).to eq([ "Alan", "Fletch" ]) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -687,11 +696,12 @@ it "does not rename non existent fields" do expect(smiths.reload).to_not respond_to(:artists) end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(members: [ "Dave" ]) end @@ -846,10 +856,11 @@ expect(new_order.reload.years).to be_nil end end end - context 'when the criteria has a collation', if: collation_supported? do + context 'when the criteria has a collation' do + min_server_version '3.4' let!(:depeche_mode) do Band.create(name: "Depeche Mode", years: 10) end