Sha256: c628b44526dfd6172bdbf865020b59a361adacfdfe1b847199617d6758e90d30

Contents?: true

Size: 751 Bytes

Versions: 102

Compression:

Stored size: 751 Bytes

Contents

require 'spec_helper'

describe Flexirest::PlainResponse do
  let(:response) { OpenStruct.new(status:200, body:"fake response", response_headers:{"X-ARC-Faked-Response" => "true", "Content-Type" => "application/json"}) }

  it "is comparable to a string" do
    expect(Flexirest::PlainResponse.new("test")).to eq "test"
  end

  it "can be instantiated from a response" do
    expect(Flexirest::PlainResponse.from_response(response)).to eq "fake response"
  end

  it "returns the response's status" do
    expect(Flexirest::PlainResponse.from_response(response)._status).to eq 200
  end

  it "returns the response's headers" do
    expect(Flexirest::PlainResponse.from_response(response)._headers["Content-Type"]).to eq "application/json"
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
flexirest-1.4.0 spec/lib/plain_response_spec.rb
flexirest-1.3.35 spec/lib/plain_response_spec.rb
flexirest-1.3.34 spec/lib/plain_response_spec.rb
flexirest-1.3.33 spec/lib/plain_response_spec.rb
flexirest-1.3.32 spec/lib/plain_response_spec.rb
flexirest-1.3.31 spec/lib/plain_response_spec.rb
flexirest-1.3.30 spec/lib/plain_response_spec.rb
flexirest-1.3.29 spec/lib/plain_response_spec.rb
flexirest-1.3.28 spec/lib/plain_response_spec.rb
flexirest-1.3.27 spec/lib/plain_response_spec.rb
flexirest-1.3.26 spec/lib/plain_response_spec.rb
flexirest-1.3.25 spec/lib/plain_response_spec.rb
flexirest-1.3.24 spec/lib/plain_response_spec.rb
flexirest-1.3.22 spec/lib/plain_response_spec.rb
flexirest-1.3.21 spec/lib/plain_response_spec.rb
flexirest-1.3.20 spec/lib/plain_response_spec.rb
flexirest-1.3.19 spec/lib/plain_response_spec.rb
flexirest-1.3.18 spec/lib/plain_response_spec.rb
flexirest-1.3.17 spec/lib/plain_response_spec.rb
flexirest-1.3.16 spec/lib/plain_response_spec.rb