require File.expand_path("../../../spec_helper", __FILE__)

module Selenium
  module WebDriver
    module Remote
      module Http
        describe Common do

          it "sends Content-Length=0 header for POST requests without a command in the body" do
            common = Common.new
            common.server_url = URI.parse("http://server")

            common.should_receive(:request).
                  with(:post, URI.parse("http://server/clear"),
                        hash_including("Content-Length" => "0"), nil)

            common.call(:post, "clear", nil)
          end

        end # Common
      end # Http
    end # Remote
  end # WebDriver
end # Selenium
require File.expand_path("../../../spec_helper", __FILE__)

module Selenium
  module WebDriver
    module Remote
      module Http
        describe Common do

          it "sends non-empty body header for POST requests without command data" do
            common = Common.new
            common.server_url = URI.parse("http://server")

            common.should_receive(:request).
                  with(:post, URI.parse("http://server/clear"),
                        hash_including("Content-Length" => "2"), "{}")

            common.call(:post, "clear", nil)
          end

        end # Common
      end # Http
    end # Remote
  end # WebDriver
end # Selenium
Fix spec for last change.
JariBakken: Fix spec for last change.

git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@13679 07704840-8298-11de-bf8c-fd130f914ac9
