Sha256: ca142285a9d18b9a68d92022384b8d12cc42bd2e729f5553242dd2389d9366d2

Contents?: true

Size: 1.4 KB

Versions: 4

Compression:

Stored size: 1.4 KB

Contents

shared_examples 'Unidom::Inventory::Concerns::AsStore' do |model_attributes|

  before :each do
  end

  after :each do
  end

  context do

    grouped_inventory_item_1_attributes = {
      stored_id:   SecureRandom.uuid,
      stored_type: 'Unidom::Inventory::Stored::Mock',
      lot_id:      SecureRandom.uuid,
      quantity:    10.00
    }

    grouped_inventory_item_2_attributes = {
      stored_id:   SecureRandom.uuid,
      stored_type: 'Unidom::Inventory::Stored::Mock',
      lot_id:      SecureRandom.uuid,
      quantity:    20.00
    }

    it_behaves_like 'has_many', model_attributes, :grouped_inventory_items, Unidom::Inventory::GroupedInventoryItem, [ grouped_inventory_item_1_attributes, grouped_inventory_item_2_attributes ]

    serialized_inventory_item_1_attributes = {
      stored_id:     SecureRandom.uuid,
      stored_type:   'Unidom::Inventory::Stored::Mock',
      lot_id:        SecureRandom.uuid,
      serial_number: SecureRandom.hex(16)
    }

    serialized_inventory_item_2_attributes = {
      stored_id:     SecureRandom.uuid,
      stored_type:   'Unidom::Inventory::Stored::Mock',
      lot_id:        SecureRandom.uuid,
      serial_number: SecureRandom.hex(16)
    }

    it_behaves_like 'has_many', model_attributes, :serialized_inventory_items, Unidom::Inventory::SerializedInventoryItem, [ serialized_inventory_item_1_attributes, serialized_inventory_item_2_attributes ]

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unidom-inventory-2.0.1 lib/rspec/models/unidom/inventory/concerns/as_store_shared_examples.rb
unidom-inventory-2.0 lib/rspec/models/unidom/inventory/concerns/as_store_shared_examples.rb
unidom-inventory-1.0.5 lib/rspec/models/unidom/inventory/concerns/as_store_shared_examples.rb
unidom-inventory-1.0.4 lib/rspec/models/unidom/inventory/concerns/as_store_shared_examples.rb