Sha256: 59316c8b12d0a3b6d459a9303827b54bba718e5e86f0763caccfa7d2f5ec1b64

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe Restfulness::Requests::AuthorizationHeader do

  describe "#initialize" do

    let :klass do
      Restfulness::Requests::AuthorizationHeader
    end

    it "should accept standard header" do
      obj = klass.new("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
      obj.schema.should eql("Basic")
      obj.params.should eql("QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    end

    it "should accept non-standard schema" do
      obj = klass.new("bAsic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
      obj.schema.should eql("Basic")
      obj.params.should eql("QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    end

    it "should ignore any whitespace" do
      obj = klass.new(" Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== ")
      obj.schema.should eql("Basic")
      obj.params.should eql("QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
    end

    it "should append additional stuff" do
      obj = klass.new("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== foooo")
      obj.schema.should eql("Basic")
      obj.params.should eql("QWxhZGRpbjpvcGVuIHNlc2FtZQ== foooo")
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restfulness-0.3.2 spec/unit/requests/authorization_header_spec.rb
restfulness-0.3.1 spec/unit/requests/authorization_header_spec.rb