Sha256: 4e4361a995cd2ad82af7b76ab933eb37cfd371c43c692c1ba267f8533b874255

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

describe Unidom::Inventory::SerializedInventoryItem, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      stored_id:     SecureRandom.uuid,
      stored_type:   'Unidom::Inventory::Stored::Mock',
      store_id:      SecureRandom.uuid,
      store_type:    'Unidom::Inventory::Store::Mock',
      lot_id:        SecureRandom.uuid,
      serial_number: '123456789012'
    }

    #serial_number_max_length = described_class.columns_hash['serial_number'].limit

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

=begin
    it_behaves_like 'validates', model_attributes, :serial_number,
      {                      } => 0,
      { serial_number: nil   } => 2,
      { serial_number: ''    } => 2,
      { serial_number: '1'   } => 1,
      { serial_number: '11'  } => 0,
      { serial_number: '111' } => 0,
      { serial_number: 'A'   } => 1,
      { serial_number: 'AA'  } => 0,
      { serial_number: 'AAA' } => 0,
      { serial_number: '1'*(serial_number_max_length-1) } => 0,
      { serial_number: '1'*serial_number_max_length     } => 0,
      { serial_number: '1'*(serial_number_max_length+1) } => 1,
      { serial_number: 'A'*(serial_number_max_length-1) } => 0,
      { serial_number: 'A'*serial_number_max_length     } => 0,
      { serial_number: 'A'*(serial_number_max_length+1) } => 1
=end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-inventory-1.0 lib/rspec/models/unidom/inventory/serialized_inventory_item_spec.rb