Sha256: 3aecdbb905abe287785403697d324adf2a01b46ec4dcf3126cd3825d76f02d36

Contents?: true

Size: 812 Bytes

Versions: 19

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper'

describe GnipApi::Response do
  before { @uri = URI('http://somewhere.com') }
  it 'creates a response' do
    request = GnipApi::Request.new_get @uri
    expect(Proc.new{GnipApi::Response.new(request, 200, 'body', {:header => 'a header'})}).not_to raise_error
  end

  describe 'response data' do
    before do
      @status = 100
      @body = 'something'
      @headers = {:header => 'something'}
      @request = GnipApi::Request.new_get @uri
      @response = GnipApi::Response.new(@request, @status, @body, @headers)
    end
    
    it 'has a status' do
      expect(@response.status).to eq(@status)
    end
    
    it 'has a body' do
      expect(@response.body).to eq(@body)
    end
    
    it 'has headers' do
      expect(@response.headers).to eq(@headers)
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gnip_api-1.1.3 spec/gnip_api/response_spec.rb
gnip_api-1.1.2 spec/gnip_api/response_spec.rb
gnip_api-1.1.1 spec/gnip_api/response_spec.rb
gnip_api-1.1.0 spec/gnip_api/response_spec.rb
gnip_api-1.0.6 spec/gnip_api/response_spec.rb
gnip_api-1.0.5 spec/gnip_api/response_spec.rb
gnip_api-1.0.4 spec/gnip_api/response_spec.rb
gnip_api-1.0.3 spec/gnip_api/response_spec.rb
gnip_api-1.0.2 spec/gnip_api/response_spec.rb
gnip_api-1.0.1 spec/gnip_api/response_spec.rb
gnip_api-1.0.0 spec/gnip_api/response_spec.rb
gnip_api-0.0.9 spec/gnip_api/response_spec.rb
gnip_api-0.0.8 spec/gnip_api/response_spec.rb
gnip_api-0.0.7 spec/gnip_api/response_spec.rb
gnip_api-0.0.6 spec/gnip_api/response_spec.rb
gnip_api-0.0.5 spec/gnip_api/response_spec.rb
gnip_api-0.0.4 spec/gnip_api/response_spec.rb
gnip_api-0.0.3 spec/gnip_api/response_spec.rb
gnip_api-0.0.2 spec/gnip_api/response_spec.rb