Sha256: 67774a289aae56394b355f018a40360ae4a2d3fd6824f5455e0e07873d2d3cfb

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

require "spec_helper"

module ShipCompliant
  describe Configuration do

    before do
      ShipCompliant.configuration = nil
      ShipCompliant.configure do |c|
        c.partner_key = 'abc-123'
        c.username = 'bob@example.com'
        c.password = 'secret'
      end
    end
    
    it "stores user credentials" do
      ShipCompliant.configuration.partner_key.should == 'abc-123'
      ShipCompliant.configuration.username.should == 'bob@example.com'
      ShipCompliant.configuration.password.should == 'secret'
    end

    it "creates authentication hash" do
      ShipCompliant.configuration.credentials.should == {
        'PartnerKey' => 'abc-123',
        'Username' => 'bob@example.com',
        'Password' => 'secret'
      }
    end

    it "defaults log to true" do
      ShipCompliant.configuration.log.should == true
    end

    context "wsdl" do
      it "defaults to core services" do
        ShipCompliant.configuration.wsdl.should == 'https://ws-dev.shipcompliant.com/services/1.2/coreservice.asmx?WSDL'
      end

      it "can be changed" do
        ShipCompliant.configure do |c|
          c.wsdl = 'http://example.com'
        end
        ShipCompliant.configuration.wsdl.should == 'http://example.com'
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ship_compliant-0.2.0 spec/lib/ship_compliant/configuration_spec.rb
ship_compliant-0.1.2 spec/lib/ship_compliant/configuration_spec.rb
ship_compliant-0.1.1 spec/lib/ship_compliant/configuration_spec.rb
ship_compliant-0.1.0 spec/lib/ship_compliant/configuration_spec.rb