spec/requests/translate_spec.rb in deepl-rb-2.2.4 vs spec/requests/translate_spec.rb in deepl-rb-2.3.0

- old
+ new

@@ -149,10 +149,11 @@ end end context 'When performing a valid request with tag handling' do let(:text) { '<p>Sample text</p>' } + let(:options) { { tag_handling: 'xml' } } it 'should return a text object' do text = subject.request expect(text).to be_a(DeepL::Resources::Text) @@ -161,17 +162,17 @@ end end context 'When performing a valid request and passing a variable' do let(:text) { 'Welcome and <code>Hello great World</code> Good Morning!' } - let(:options) { { ignore_tags: 'code, span' } } + let(:options) { { tag_handling: 'xml', ignore_tags: 'code,span' } } it 'should return a text object' do text = subject.request expect(text).to be_a(DeepL::Resources::Text) - expect(text.text).to eq('Bienvenido y <code>Hello great World</code> Buenos días!') + expect(text.text).to eq('Bienvenido y <code>Hello great World</code> ¡Buenos días!') expect(text.detected_source_language).to eq('EN') end end context 'When performing a bad request' do @@ -198,10 +199,10 @@ context 'When using an invalid target language' do let(:target_lang) { nil } it 'should raise a bad request error' do - message = "Parameter 'target_lang' not specified." + message = "Value for 'target_lang' not supported." expect { subject.request }.to raise_error(DeepL::Exceptions::BadRequest, message) end end end end