spec/requests/translate_text_spec.rb in deepl-rb-0.0.1 vs spec/requests/translate_text_spec.rb in deepl-rb-1.0.0

- old
+ new

@@ -43,9 +43,21 @@ expect(texts.last.text).to eq('Palabra') expect(texts.last.detected_source_language).to eq('EN') end end + context 'When performing a valid request with tag handling' do + let(:text) { '<p>Sample text</p>' } + + it 'should return a text object' do + text = subject.request + + expect(text).to be_a(DeepL::Resources::Text) + expect(text.text).to eq('<p>Texto de muestra</p>') + expect(text.detected_source_language).to eq('EN') + end + end + context 'When performing a bad request' do context 'When using an invalid token' do let(:api) do api = build_deepl_api api.configuration.auth_key = 'invalid'