Sha256: 0ec26b0a4a6d16bb61793f92d5df601589466bae2920ab7bf29e549e6115bac4
Contents?: true
Size: 819 Bytes
Versions: 13
Compression:
Stored size: 819 Bytes
Contents
require 'spec_helper' describe ::Trax::Model::UUID do let(:product) { ::Product.create(:name => "iMac") } subject{ product.uuid } context "dsl register methods" do before do ::Trax::Model::UUID.register do prefix "9a", ::Person end end it { described_class.prefix_map.should have_key("9a") } it { described_class.klass_prefix_map.should have_key(Person) } end its(:record_type) { should eq ::Product } its(:record) { should eq product } describe ".generate" do context "with prefix" do let(:prefixed_uuid) { described_class.generate("1a") } it { prefixed_uuid[0..1].should eq "1a" } end context "without prefix" do let(:unprefixed_uuid) { described_class.generate } it { unprefixed_uuid.length.should eq 36 } end end end
Version data entries
13 entries across 13 versions & 1 rubygems