Contents

Availability depending on Pools

As an Inventory Manager I want to be sure that a customer only gets to see models from inventory pools he has access to In order to prevent a customer from ordering things he cannot borrow

Scenario: Basic

  • Given 2 inventory pools
  • And a model 'Coffee Mug' exists
  • And this model has 2 items in inventory pool 1
  • And this model has 3 items in inventory pool 2
  • And customer 'joe' has access to inventory pool 1
  • And customer 'jack' has access to inventory pool 1 and 2
  • And customer 'john' has access to inventory pool 2
  • Then the maximum number of available 'Coffee Mug' for 'joe' is 2
  • And the maximum number of available 'Coffee Mug' for 'jack' is 5
  • And the maximum number of available 'Coffee Mug' for 'john' is 3

Scenario: Items available in different pools

  • Given 2 inventory pools
  • And a model 'Coffee Mug' exists
  • And this model has 2 items in inventory pool 1
  • And this model has 3 items in inventory pool 2
  • And a model 'Coffee Machine' exists
  • And this model has 1 item in inventory pool 1
  • And customer 'jack' has access to inventory pool 1 and 2
  • When 'jack' orders 2 'Coffee Mug' from inventory pool 1
  • And 'jack' orders 1 'Coffee Machine' from inventory pool 1
  • And all reservations of 'jack' are submitted
  • Then 1 order exists for inventory pool 1
  • And it asks for 3 items
  • And 0 orders exist for inventory pool 2

Scenario: Customer orders the same item multiple times, thus exceeding maximum quantity

  • Given 1 inventory pool
  • And a model 'Pink Hairbrush' exists
  • And this model has 3 items in inventory pool 1
  • And customer 'samantha' has access to inventory pool 1
  • When 'samantha' orders 3 'Pink Hairbrush' from inventory pool 1
  • Then this user has 3 unsubmitted reservations, which 3 are available
  • When 'samantha' orders 2 'Pink Hairbrush' from inventory pool 1 for the same time
  • Then this user has 5 unsubmitted reservations, which 0 are available

Scenario: Customer can decide from which pool he orders

  • Given 2 inventory pools
  • And a model 'Coffee Mug' exists
  • And this model has 3 items in inventory pool 1
  • And this model has 1 items in inventory pool 2
  • And customer 'jack' has access to inventory pool 1
  • And customer 'jack' has access to inventory pool 2
  • When 'jack' orders 2 'Coffee Mug' from inventory pool 1
  • Then this user has 2 unsubmitted reservations, which 2 are available
  • When 'jack' orders 2 'Coffee Mug' from inventory pool 2
  • Then this user has 4 unsubmitted reservations, which 2 are available

Source: features/technical/availability_inventory_pool_story.feature at commit eb240d9e, Leihs (GPL license).