Skip to content

Commit 3c4e729

Browse files
committed
Update tests to use appropriate result fields
1 parent 050c263 commit 3c4e729

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spec/mongo/collection_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@
618618
end
619619

620620
it 'deletes the first matching document in the collection' do
621-
expect(response.written_count).to eq(1)
621+
expect(response.deleted_count).to eq(1)
622622
end
623623
end
624624

@@ -633,7 +633,7 @@
633633
end
634634

635635
it 'deletes the first document in the collection' do
636-
expect(response.written_count).to eq(1)
636+
expect(response.deleted_count).to eq(1)
637637
end
638638
end
639639
end
@@ -655,14 +655,14 @@
655655
end
656656

657657
it 'deletes the matching documents in the collection' do
658-
expect(authorized_collection.delete_many(selector).written_count).to eq(1)
658+
expect(authorized_collection.delete_many(selector).deleted_count).to eq(1)
659659
end
660660
end
661661

662662
context 'when no selector was provided' do
663663

664664
it 'deletes all the documents in the collection' do
665-
expect(authorized_collection.delete_many.written_count).to eq(2)
665+
expect(authorized_collection.delete_many.deleted_count).to eq(2)
666666
end
667667
end
668668
end
@@ -692,7 +692,7 @@
692692
end
693693

694694
it 'updates the first matching document in the collection' do
695-
expect(response.written_count).to eq(1)
695+
expect(response.modified_count).to eq(1)
696696
end
697697

698698
it 'updates the documents in the collection' do
@@ -711,7 +711,7 @@
711711
end
712712

713713
it 'reports that no documents were written' do
714-
expect(response.written_count).to eq(0)
714+
expect(response.modified_count).to eq(0)
715715
end
716716

717717
it 'does not insert the document' do
@@ -753,7 +753,7 @@
753753
end
754754

755755
it 'reports that no documents were written' do
756-
expect(response.written_count).to eq(0)
756+
expect(response.modified_count).to eq(0)
757757
end
758758

759759
it 'does not insert the document' do
@@ -787,7 +787,7 @@
787787
end
788788

789789
it 'returns the number updated' do
790-
expect(response.written_count).to eq(2)
790+
expect(response.modified_count).to eq(2)
791791
end
792792

793793
it 'updates the documents in the collection' do
@@ -807,7 +807,7 @@
807807
end
808808

809809
it 'reports that no documents were updated' do
810-
expect(response.written_count).to eq(0)
810+
expect(response.modified_count).to eq(0)
811811
end
812812

813813
it 'updates no documents in the collection' do
@@ -846,7 +846,7 @@
846846
end
847847

848848
it 'reports that no documents were updated' do
849-
expect(response.written_count).to eq(0)
849+
expect(response.modified_count).to eq(0)
850850
end
851851

852852
it 'updates no documents in the collection' do
@@ -876,7 +876,7 @@
876876
end
877877

878878
it 'updates the first matching document in the collection' do
879-
expect(response.written_count).to eq(1)
879+
expect(response.modified_count).to eq(1)
880880
end
881881

882882
it 'updates the documents in the collection' do
@@ -896,7 +896,7 @@
896896
end
897897

898898
it 'reports that no documents were updated' do
899-
expect(response.written_count).to eq(0)
899+
expect(response.modified_count).to eq(0)
900900
end
901901

902902
it 'updates no documents in the collection' do
@@ -935,7 +935,7 @@
935935
end
936936

937937
it 'reports that no documents were updated' do
938-
expect(response.written_count).to eq(0)
938+
expect(response.modified_count).to eq(0)
939939
end
940940

941941
it 'updates no documents in the collection' do

0 commit comments

Comments
 (0)