Sha256: ce556168a62cea960ddc8406b9b58f6e6f0ad1b1e3ea9c911fd55386f14d0f71

Contents?: true

Size: 535 Bytes

Versions: 28

Compression:

Stored size: 535 Bytes

Contents

require 'spec_helper'
require 'ostruct'

describe 'Intercom::Request' do
  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

  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

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
intercom-3.5.12 spec/unit/intercom/request_spec.rb
intercom-3.5.11 spec/unit/intercom/request_spec.rb
intercom-3.5.10 spec/unit/intercom/request_spec.rb
intercom-3.5.9 spec/unit/intercom/request_spec.rb
intercom-3.5.8 spec/unit/intercom/request_spec.rb
intercom-3.5.7 spec/unit/intercom/request_spec.rb
intercom-3.5.6 spec/unit/intercom/request_spec.rb
intercom-3.5.5 spec/unit/intercom/request_spec.rb
intercom-3.5.4 spec/unit/intercom/request_spec.rb
intercom-3.5.3 spec/unit/intercom/request_spec.rb
intercom-3.5.2 spec/unit/intercom/request_spec.rb
cogniteev-intercom-2.5.4 spec/unit/intercom/request_spec.rb
intercom-3.5.1 spec/unit/intercom/request_spec.rb
intercom-3.4.0 spec/unit/intercom/request_spec.rb
intercom-3.3.0 spec/unit/intercom/request_spec.rb
intercom-3.2.0 spec/unit/intercom/request_spec.rb
intercom-3.1.0 spec/unit/intercom/request_spec.rb
intercom-3.0.6 spec/unit/intercom/request_spec.rb
intercom-3.0.5 spec/unit/intercom/request_spec.rb
intercom-3.0.4 spec/unit/intercom/request_spec.rb