Sha256: 1bcfddf82c9eaaa76c92125fa25ba687a7a5d1b4959713c4d7bb2983a09a3f39

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

require 'helper'

describe Toy::Identity::UUIDKeyFactory do
  uses_constants('User')

  it "should use String as store_type" do
    Toy::Identity::UUIDKeyFactory.new.key_type.should be(String)
  end

  it "should use uuid for next key" do
    Toy::Identity::UUIDKeyFactory.new.next_key(nil).length.should == 36
  end

  describe "Declaring key to be object_id" do
    before(:each) do
      User.key(:uuid)
    end

    it "returns String as .key_type" do
      User.key_type.should be(String)
    end

    it "sets id attribute to String type" do
      User.attributes['id'].type.should be(String)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
toystore-0.7.0 spec/toy/identity/uuid_key_factory_spec.rb
toystore-0.6.6 spec/toy/identity/uuid_key_factory_spec.rb
toystore-0.6.5 spec/toy/identity/uuid_key_factory_spec.rb
toystore-0.6.4 spec/toy/identity/uuid_key_factory_spec.rb