Sha256: 1b9a1880982b73ae7ac42989fc2893be2002c4b04cd4d2655fdf8afec3b37a91

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

require './spec/spec_helper'

describe FlexmlsApi do
  it "should load the version" do
    subject::VERSION.should match(/\d+\.\d+\.\d+/)
  end

  it "should give me a client connection" do
    subject.client.class.should eq FlexmlsApi::Client
  end

  it "should reset my connection" do
    c1 = subject.client
    subject.reset
    subject.client.should_not eq c1
  end

end

describe FlexmlsApi::Authentication, "Authentication"  do
  describe "build_param_hash" do
    before(:each) do
      class StubClass
      end
      @auth_stub = StubClass.new
      @auth_stub.extend(FlexmlsApi::Authentication)
    end

    it "Should return a blank string when passed nil" do
      @auth_stub.build_param_string(nil).should be_empty
    end

    it "should return a correct param string for one item" do
      @auth_stub.build_param_string({:foo => "bar"}).should match "foobar"
    end

    it "should alphabatize the param names by key first, then by value" do
      @auth_stub.build_param_string({:zoo => "zar", :ooo => "car"}).should match "ooocarzoozar"
      @auth_stub.build_param_string({:Akey => "aValue", :aNotherkey => "AnotherValue"}).should 
           match "AkeyaValueaNotherkeyAnotherValue"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flexmls_api-0.3.6 spec/unit/flexmls_api_spec.rb
flexmls_api-0.3.3 spec/unit/flexmls_api_spec.rb
flexmls_api-0.3.2 spec/unit/flexmls_api_spec.rb