Sha256: 143c36ebbcdd5873ec64527af0147aef8dbd8d18def16eb4f8b8edb18ed18b9c

Contents?: true

Size: 640 Bytes

Versions: 3

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'

describe WebClient::Response do

  it 'Success' do
    response = WebClient::Response.new HttpResponseFactory.ok('OK')

    response.code.should eq '200'
    response.body.should eq 'OK'
    response.content_type.should eq 'text/html'
    response.type.should be Net::HTTPOK
    response.success?.should be_true
  end

  it 'Not found' do
    response = WebClient::Response.new HttpResponseFactory.not_found

    response.code.should eq '404'
    response.body.should be_nil
    response.content_type.should eq 'text/html'
    response.type.should be Net::HTTPNotFound
    response.success?.should be_false
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
web_client-0.0.6 spec/response_spec.rb
web_client-0.0.5 spec/response_spec.rb
web_client-0.0.4 spec/response_spec.rb