add diagnostics for flaky test

add diagnostics for flaky test

diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb
index 6eabf54..b83c689 100644
--- a/spec/controllers/search_controller_spec.rb
+++ b/spec/controllers/search_controller_spec.rb
@@ -49,6 +49,12 @@ describe SearchController do
       )
       expect(response).to be_success
       data = JSON.parse(response.body)
+      unless (data && data['topics'] && data['topics'][0] && data['topics'][0]['id'])
+        puts "FLAKY TEST"
+        p data
+        p my_post.topic
+        p my_post
+      end
       expect(data['topics'][0]['id']).to eq(my_post.topic_id)
     end
   end

GitHub sha: 658c2f52