about summary refs log tree commit diff
path: root/spec/fixtures/requests
diff options
context:
space:
mode:
authorRenato "Lond" Cerqueira <renato@lond.com.br>2019-01-14 17:28:41 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-01-14 17:28:41 +0100
commit5c5e14c816eb0871344bb69a96bc4bb38e0d3061 (patch)
treeccb3b71f7c2c570530938f61ee375f7414b36592 /spec/fixtures/requests
parentb4e6384aeafc9011707aa27d4948aaa9ca907db3 (diff)
Fix undefined method error in sidekiq (#9807)
* Fix undefined method error in sidekiq

Body can be not nil but still be empty, which causes a
`NoMethodError: undefined method `[]' for nil:NilClass` further in the
code. This checks for an empty body to avoid the issue.

* Fix codeclimate issue
Diffstat (limited to 'spec/fixtures/requests')
-rw-r--r--spec/fixtures/requests/oembed_json_empty.html7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/fixtures/requests/oembed_json_empty.html b/spec/fixtures/requests/oembed_json_empty.html
new file mode 100644
index 000000000..4b02413aa
--- /dev/null
+++ b/spec/fixtures/requests/oembed_json_empty.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <link href='https://host.test/empty_provider.json' rel='alternate' type='application/json+oembed'>
+  </head>
+  <body></body>
+</html>