Skip to content

Commit

Permalink
Add sanity test on collection for inserted ids
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Mar 26, 2015
1 parent 8efba1e commit 7fd6a33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/mongo/collection_spec.rb
Expand Up @@ -294,6 +294,10 @@
it 'inserts the documents into the collection', unless: write_command_enabled? do
expect(result.written_count).to eq(0)
end

it 'contains the ids in the result' do
expect(result.inserted_ids.size).to eq(2)
end
end

describe '#insert_one' do
Expand All @@ -313,6 +317,10 @@
it 'inserts the document into the collection', unless: write_command_enabled? do
expect(result.written_count).to eq(0)
end

it 'contains the id in the result' do
expect(result.inserted_id).to_not be_nil
end
end

describe '#inspect' do
Expand Down

0 comments on commit 7fd6a33

Please sign in to comment.