Sha256: f02ea28feadd13fc1de559106bc3cd3de2798fc5c8d6eb48eec0592ea8f503bb

Contents?: true

Size: 842 Bytes

Versions: 17

Compression:

Stored size: 842 Bytes

Contents

require File.expand_path(File.dirname(__FILE__)+'/../spec_helper')
describe Restfully::HTTP::Response do

  it "should correctly initialize the attributes" do
    response = Restfully::HTTP::Response.new(404, {:content_type => 'application/json;charset=utf-8'}, '{"property1": "value1", "property2": "value2"}')
    response.status.should == 404
    response.headers.should == {
      'Content-Type' => 'application/json;charset=utf-8'
    }
    response.body.should == {
      'property1' => 'value1',
      'property2' => 'value2'
    }
  end
  it "should return the unserialized body" do
    response = Restfully::HTTP::Response.new(404, {:content_type => 'application/json;charset=utf-8'}, '{"property1": "value1", "property2": "value2"}')
    response.raw_body.should == "{\"property1\": \"value1\", \"property2\": \"value2\"}"
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
restfully-0.6.3 spec/http/response_spec.rb
restfully-0.6.2 spec/http/response_spec.rb
restfully-0.6.1 spec/http/response_spec.rb
restfully-0.6.0 spec/http/response_spec.rb
restfully-0.5.10 spec/http/response_spec.rb
restfully-0.5.9 spec/http/response_spec.rb
restfully-0.5.8 spec/http/response_spec.rb
restfully-0.5.7 spec/http/response_spec.rb
restfully-0.5.6 spec/http/response_spec.rb
restfully-0.5.5 spec/http/response_spec.rb
restfully-0.5.4 spec/http/response_spec.rb
restfully-0.5.3 spec/http/response_spec.rb
restfully-0.5.2 spec/http/response_spec.rb
restfully-0.5.1 spec/http/response_spec.rb
restfully-0.5.0 spec/http/response_spec.rb
restfully-0.4.1 spec/http/response_spec.rb
restfully-0.4.0 spec/http/response_spec.rb