FEATURE: allow title only onebox

FEATURE: allow title only onebox

diff --git a/lib/onebox/engine/allowlisted_generic_onebox.rb b/lib/onebox/engine/allowlisted_generic_onebox.rb
index 53f6dd0..59ec6db 100644
--- a/lib/onebox/engine/allowlisted_generic_onebox.rb
+++ b/lib/onebox/engine/allowlisted_generic_onebox.rb
@@ -292,8 +292,7 @@ module Onebox
       end
 
       def has_text?
-        !Onebox::Helpers.blank?(data[:title]) &&
-        !Onebox::Helpers.blank?(data[:description])
+        !Onebox::Helpers.blank?(data[:title])
       end
 
       def is_image?
diff --git a/spec/fixtures/cnn.response b/spec/fixtures/cnn.response
new file mode 100644
index 0000000..3c0e90f
--- /dev/null
+++ b/spec/fixtures/cnn.response
@@ -0,0 +1,4 @@
+<!DOCTYPE html><html><head><title data-rh="true">People are fostering and adopting pets during the pandemic  </title>
+<meta data-rh="true" charset="utf-8"/><meta data-rh="true" name="viewport" content="width=device-width, initial-scale=1"/><meta data-rh="true" name="section" content="health"/><meta data-rh="true" name="keywords" content="health, People are fostering and adopting pets during the pandemic"/><meta data-rh="true" name="pubdate" content="2020-05-15T11:09:50Z"/><meta data-rh="true" name="lastmod" content="2020-05-15T11:15:43Z"/><meta data-rh="true" property="og:site_name" content="CNN"/><meta data-rh="true" property="og:url" content="https://www.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html"/><meta data-rh="true" property="og:title" content="People are fostering and adopting pets during the pandemic  "/><meta data-rh="true" property="og:image" content="https://cdn.cnn.com/cnnnext/dam/assets/200427093451-10-coronavirus-people-adopting-pets-super-tease.jpg"/><meta data-rh="true" property="og:image:width" content="1100"/><meta data-rh="true" property="og:image:height" content="619"/><meta data-rh="true" property="og:image:alt" content="CNN - People are fostering and adopting pets during the pandemic  "/><meta data-rh="true" property="og:type" content="website"/><meta data-rh="true" property="fb:app_id" content="80401312489"/><meta data-rh="true" property="fb:pages" content="5550296508,18793419640"/><meta data-rh="true" name="twitter:card" content="summary_large_image"/><meta data-rh="true" name="twitter:title" content="People are fostering and adopting pets during the pandemic  "/><meta data-rh="true" name="twitter:image" content="https://cdn.cnn.com/cnnnext/dam/assets/200427093451-10-coronavirus-people-adopting-pets-super-tease.jpg"/><meta data-rh="true" name="twitter:image:alt" content="People are fostering and adopting pets during the pandemic  "/>
+<link data-rh="true" rel="preconnect" href="//cdn.cnn.com" crossorigin="anonymous"/><link data-rh="true" rel="preconnect" href="//www.i.cdn.cnn.com" crossorigin="anonymous"/><link data-rh="true" rel="preconnect" href="//i.cdn.cnn.com" crossorigin="anonymous"/><link data-rh="true" rel="preconnect" href="//dynaimage.cdn.cnn.com" crossorigin="anonymous"/><link data-rh="true" rel="canonical" href="https://www.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html"/><link data-rh="true" rel="image_src" href="https://cdn.cnn.com/cnnnext/dam/assets/200427093451-10-coronavirus-people-adopting-pets-super-tease.jpg"/><link data-rh="true" rel="alternate" href="https://www.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html" hreflang="en-us"/><link data-rh="true" rel="alternate" href="https://www.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html" hreflang="en-ca"/><link data-rh="true" rel="alternate" href="https://edition.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html" hreflang="en-gb"/><link data-rh="true" rel="alternate" href="https://edition.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html" hreflang="en"/><link data-rh="true" rel="dns-prefetch" href="//native.sharethrough.com/assets/sfp.js"/>
+</html>
diff --git a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
index 5fee2a2..08881f3 100644
--- a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
+++ b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
@@ -177,4 +177,21 @@ describe Onebox::Engine::AllowlistedGenericOnebox do
     end
   end
 
+  describe 'missing description' do
+    context 'works without description' do
+      let(:cnn_url) { "https://edition.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html" }
+      before do
+        fake(cnn_url, response('cnn'))
+      end
+
+      it 'shows basic onebox' do
+        onebox = described_class.new(cnn_url)
+        expect(onebox.to_html).not_to be_nil
+        expect(onebox.to_html).to include("https://edition.cnn.com/2020/05/15/health/gallery/coronavirus-people-adopting-pets-photos/index.html")
+        expect(onebox.to_html).to include("https://cdn.cnn.com/cnnnext/dam/assets/200427093451-10-coronavirus-people-adopting-pets-super-tease.jpg")
+        expect(onebox.to_html).to include("People are fostering and adopting pets during the pandemic")
+      end
+    end
+  end
+
 end
diff --git a/templates/allowlistedgeneric.mustache b/templates/allowlistedgeneric.mustache
index 60ae5cc..d937314 100644
--- a/templates/allowlistedgeneric.mustache
+++ b/templates/allowlistedgeneric.mustache
@@ -2,7 +2,9 @@
 
 <h3><a href='{{link}}' target="_blank" rel="noopener">{{title}}</a></h3>
 
+{{#description}}
 <p>{{description}}</p>
+{{/description}}
 
 {{#data_1}}
   <p><span class="label1">{{label_1}}: {{data_1}}</span>

GitHub sha: cb82dce8

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/abc-news-not-oneboxing-due-to-missing-description/155933/16