spec/requests/translate_spec.rb in deepl-rb-2.5.1 vs spec/requests/translate_spec.rb in deepl-rb-2.5.2
- old
+ new
@@ -327,7 +327,16 @@
message = "Value for 'target_lang' not supported."
expect { subject.request }.to raise_error(DeepL::Exceptions::BadRequest, message)
end
end
end
+
+ context 'When performing a request with too many texts' do
+ let(:text) { Array.new(10_000) { |i| "This is the sentence number #{i}" } }
+
+ it 'should raise a request entity too large error' do
+ expect { subject.request }.to raise_error(DeepL::Exceptions::RequestEntityTooLarge,
+ /request size has reached the supported limit/)
+ end
+ end
end
end