spec/mongo/collection_spec.rb in mongo-2.11.4 vs spec/mongo/collection_spec.rb in mongo-2.11.5
- old
+ new
@@ -943,9 +943,33 @@
it_behaves_like 'an operation using a session'
it_behaves_like 'a failed operation using a session'
end
end
+
+ context 'when collation has a strength' do
+ min_server_fcv '3.4'
+
+ let(:band_collection) do
+ described_class.new(database, :bands)
+ end
+
+ before do
+ band_collection.delete_many
+ band_collection.insert_many([{ name: "Depeche Mode" }, { name: "New Order" }])
+ end
+
+ let(:options) do
+ { collation: { locale: 'en_US', strength: 2 } }
+ end
+ let(:band_result) do
+ band_collection.find({ name: 'DEPECHE MODE' }, options)
+ end
+
+ it 'finds Capitalize from UPPER CASE' do
+ expect(band_result.count_documents).to eq(1)
+ end
+ end
end
describe '#drop' do
let(:database) do