Sha256: 2c648ce8194d173d365704f0cef2c001fef38b8bd6a77216d68ee185b1025b35

Contents?: true

Size: 921 Bytes

Versions: 52

Compression:

Stored size: 921 Bytes

Contents

require 'spec_helper'

describe WebMock::Util::Headers do

  it "should decode_userinfo_from_header handles basic auth" do
    authorization_header = "Basic dXNlcm5hbWU6c2VjcmV0"
    userinfo = WebMock::Util::Headers.decode_userinfo_from_header(authorization_header)
    userinfo.should == "username:secret"
  end

  describe "sorted_headers_string" do

    it "should return nice string for hash with string values" do
      WebMock::Util::Headers.sorted_headers_string({"a" => "b"}).should == "{'A'=>'b'}"
    end

    it "should return nice string for hash with array values" do
      WebMock::Util::Headers.sorted_headers_string({"a" => ["b", "c"]}).should == "{'A'=>['b', 'c']}"
    end

    it "should return nice string for hash with array values and string values" do
      WebMock::Util::Headers.sorted_headers_string({"a" => ["b", "c"], "d" => "e"}).should == "{'A'=>['b', 'c'], 'D'=>'e'}"
    end


  end

end

Version data entries

52 entries across 52 versions & 4 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/webmock-1.8.11/spec/unit/util/headers_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/webmock-1.8.11/spec/unit/util/headers_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/webmock-1.8.11/spec/unit/util/headers_spec.rb
webmock-1.20.3 spec/unit/util/headers_spec.rb
webmock-1.20.2 spec/unit/util/headers_spec.rb
webmock-1.20.1 spec/unit/util/headers_spec.rb
webmock-1.20.0 spec/unit/util/headers_spec.rb
webmock-1.19.0 spec/unit/util/headers_spec.rb
whos_dated_who-0.1.0 vendor/bundle/gems/webmock-1.18.0/spec/unit/util/headers_spec.rb
whos_dated_who-0.0.1 vendor/bundle/gems/webmock-1.18.0/spec/unit/util/headers_spec.rb
webmock-1.18.0 spec/unit/util/headers_spec.rb
webmock-1.17.4 spec/unit/util/headers_spec.rb
webmock-1.17.3 spec/unit/util/headers_spec.rb
webmock-1.17.2 spec/unit/util/headers_spec.rb
webmock-1.17.1 spec/unit/util/headers_spec.rb
webmock-1.17.0 spec/unit/util/headers_spec.rb
webmock-1.16.1 spec/unit/util/headers_spec.rb
webmock-1.16.0 spec/unit/util/headers_spec.rb
webmock-1.15.2 spec/unit/util/headers_spec.rb
webmock-1.15.0 spec/unit/util/headers_spec.rb