Sha256: 654ab64fe5b771e556aa39a5918dcca89b64315c67f1b12de7e8621bf5823ea3

Contents?: true

Size: 745 Bytes

Versions: 35

Compression:

Stored size: 745 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

module Resourceful
  describe Resource do 
    before do 
      @http_adapter = stub(:http_adapter)
      http = Resourceful::HttpAccessor.new(:http_adapter => @http_adapter)
      @resource = http.resource('http://foo.example')
    end
    
    describe "POSTing" do 
      it "should use bodies content type as the request content-type if it is known" do 
        @http_adapter.should_receive(:make_request).with(anything, anything, anything, hash_including('Content-Type' => 'application/x-special-type')).and_return([200, {}, ""])
        body = stub(:body, :content_type => 'application/x-special-type', :read => "hello there")
        @resource.post(body)
      end
    end
  
  end
end

Version data entries

35 entries across 35 versions & 5 rubygems

Version Path
paul-resourceful-0.6.0 spec/resourceful/resource_spec.rb
pezra-resourceful-0.5.4 spec/resourceful/resource_spec.rb
pezra-resourceful-0.6.0 spec/resourceful/resource_spec.rb
pezra-resourceful-0.7.0 spec/resourceful/resource_spec.rb
abiquo-etk-0.6.4 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.6.3 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.6.2 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.6.1 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.6.0 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.5.9 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.5.8 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.5.3 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.42 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.33 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.32 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.29 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.25 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.24 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.23 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb
abiquo-etk-0.4.22 vendor/resourceful-1.0.1/spec/resourceful/resource_spec.rb