Sha256: 33e11803fd1c6d4ad8d607fecaaec2c515af7490fb1588e6eb2848ed36b42f44

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 Bytes

Contents

require 'spec_helper'

describe ApiClient::Dispatcher do
  describe "#_get" do
    before :each do
      FakeWeb.register_uri(:get, "http://api.example.com/user/5", :status => "200")
    end

    it "should return the response code and body" do
      ApiClient::Base._get("http://api.example.com/user/5").should be_a(Net::HTTPOK)
    end
  end

  describe "#_post" do
    before :each do
      FakeWeb.register_uri(:post, "http://api.example.com/user/5", :status => "201")
    end

    it "should return the response code and body" do
      ApiClient::Base._post("http://api.example.com/user/5", {}).should be_a(Net::HTTPCreated)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api-client-1.1.1 spec/api-client/dispatcher_spec.rb
api-client-1.1.0 spec/api-client/dispatcher_spec.rb