Skip to content

Commit 7fd6a33

Browse files
committed
Add sanity test on collection for inserted ids
1 parent 8efba1e commit 7fd6a33

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/mongo/collection_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
it 'inserts the documents into the collection', unless: write_command_enabled? do
295295
expect(result.written_count).to eq(0)
296296
end
297+
298+
it 'contains the ids in the result' do
299+
expect(result.inserted_ids.size).to eq(2)
300+
end
297301
end
298302

299303
describe '#insert_one' do
@@ -313,6 +317,10 @@
313317
it 'inserts the document into the collection', unless: write_command_enabled? do
314318
expect(result.written_count).to eq(0)
315319
end
320+
321+
it 'contains the id in the result' do
322+
expect(result.inserted_id).to_not be_nil
323+
end
316324
end
317325

318326
describe '#inspect' do

0 commit comments

Comments
 (0)