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.12.4 spec/lib/plain_response_spec.rb
flexirest-1.12.3 spec/lib/plain_response_spec.rb
flexirest-1.12.2 spec/lib/plain_response_spec.rb
flexirest-1.12.1 spec/lib/plain_response_spec.rb
flexirest-1.12.0 spec/lib/plain_response_spec.rb
flexirest-1.11.3 spec/lib/plain_response_spec.rb
flexirest-1.11.2 spec/lib/plain_response_spec.rb
flexirest-1.11.1 spec/lib/plain_response_spec.rb
flexirest-1.11.0 spec/lib/plain_response_spec.rb
flexirest-1.10.12 spec/lib/plain_response_spec.rb
flexirest-1.10.11 spec/lib/plain_response_spec.rb
flexirest-1.10.10 spec/lib/plain_response_spec.rb
flexirest-1.10.9 spec/lib/plain_response_spec.rb
flexirest-1.10.8 spec/lib/plain_response_spec.rb
flexirest-1.10.7 spec/lib/plain_response_spec.rb
flexirest-1.10.6 spec/lib/plain_response_spec.rb
flexirest-1.10.5 spec/lib/plain_response_spec.rb
flexirest-1.10.4 spec/lib/plain_response_spec.rb
flexirest-1.10.3 spec/lib/plain_response_spec.rb
flexirest-1.10.2 spec/lib/plain_response_spec.rb