spec/unit/intercom/request_spec.rb in intercom-2.4.1 vs spec/unit/intercom/request_spec.rb in intercom-2.4.2
- old
+ new
@@ -5,6 +5,12 @@
it 'raises an error when a html error page rendered' do
response = OpenStruct.new(:code => 500)
req = Intercom::Request.new('path/', 'GET')
proc {req.parse_body('<html>somethjing</html>', response)}.must_raise(Intercom::ServerError)
end
-end
\ No newline at end of file
+
+ it 'parse_body returns nil if decoded_body is nil' do
+ response = OpenStruct.new(:code => 500)
+ req = Intercom::Request.new('path/', 'GET')
+ req.parse_body(nil, response).must_equal(nil)
+ end
+end