Skip to content

Commit 3b51099

Browse files
committed
RUBY-1022: Ensure auth failures are raised
1 parent 834f6ee commit 3b51099

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/mongo/collection_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,15 @@
472472

473473
context 'when the user is not authorized' do
474474

475+
let(:view) do
476+
unauthorized_collection.find
477+
end
478+
479+
it 'iterates over the documents' do
480+
expect {
481+
view.each{ |document| document }
482+
}.to raise_error(Mongo::Error::OperationFailure)
483+
end
475484
end
476485

477486
context 'when documents contain potential error message fields' do

0 commit comments

Comments
 (0)