Sha256: 43dc598aaed2e5b2b3dccbd1df808c53af9525ac9e436541bbc7c984020efb03

Contents?: true

Size: 1000 Bytes

Versions: 26

Compression:

Stored size: 1000 Bytes

Contents

require 'spec/spec_helper'

describe RPXNow do
  describe :mapping_integration do
    before do
      @k1 = 'http://test.myopenid.com'
      RPXNow.unmap(@k1, 1)
      @k2 = 'http://test-2.myopenid.com'
      RPXNow.unmap(@k2, 1)
    end

    it "has no mappings when nothing was mapped" do
      RPXNow.mappings(1).should == []
    end

    it "unmaps mapped keys" do
      RPXNow.map(@k2, 1)
      RPXNow.unmap(@k2, 1)
      RPXNow.mappings(1).should == []
    end

    it "maps keys to a primary key and then retrieves them" do
      RPXNow.map(@k1, 1)
      RPXNow.map(@k2, 1)
      RPXNow.mappings(1).sort.should == [@k2,@k1]
    end

    it "does not add duplicate mappings" do
      RPXNow.map(@k1, 1)
      RPXNow.map(@k1, 1)
      RPXNow.mappings(1).should == [@k1]
    end

    it "finds all mappings" do
      RPXNow.map(@k1, 1)
      RPXNow.map(@k2, 2)
      RPXNow.all_mappings.sort.should == [["1", ["http://test.myopenid.com"]], ["2", ["http://test-2.myopenid.com"]]]
    end
  end
end

Version data entries

26 entries across 26 versions & 5 rubygems

Version Path
slayer-rpx_now-0.6.25 spec/integration/mapping_spec.rb
slayer-rpx_now-0.6.24 spec/integration/mapping_spec.rb
rpx_now-0.6.24 spec/integration/mapping_spec.rb
rpx_now-0.6.23 spec/integration/mapping_spec.rb
rpx_now-0.6.22 spec/integration/mapping_spec.rb
rpx_now-0.6.21 spec/integration/mapping_spec.rb
rpx_now-0.6.20 spec/integration/mapping_spec.rb
rpx_now-0.6.19 spec/integration/mapping_spec.rb
rpx_now-0.6.18 spec/integration/mapping_spec.rb
Empact-rpx_now-0.7.0 spec/integration/mapping_spec.rb
rpx_now-0.6.17 spec/integration/mapping_spec.rb
rpx_now-0.6.16 spec/integration/mapping_spec.rb
rpx_now-0.6.15 spec/integration/mapping_spec.rb
rpx_now-0.6.14 spec/integration/mapping_spec.rb
rpx_now-0.6.13 spec/integration/mapping_spec.rb
rpx_now-0.6.12 spec/integration/mapping_spec.rb
kent-rpx_now-0.6.11 spec/integration/mapping_spec.rb
rpx_now-0.6.11 spec/integration/mapping_spec.rb
rpx_now-0.6.10 spec/integration/mapping_spec.rb
rpx_now-0.6.9 spec/integration/mapping_spec.rb