step "There is an open supplier with a menu" do
  step 'there is a confirmed and open supplier'
  @apple_pie= create :product, name: 'Apple pie', supplier: @supplier, price: 4.28
  @heineken_beer = create :product, name: 'Heineken beer', supplier: @supplier, price: 2.34

  @category_beer = create :product_category, name: 'Beer', supplier: @supplier, product_ids: [@heineken_beer.id]
  @category_lunch = create :product_category, name: 'Lunch', supplier: @supplier, product_ids: [@apple_pie.id]
  #@heineken_beer.add_product_category @category_beer
  #@category_beer.save
  #@category_lunch.save
  #@apple_pie.add_product_category @category_lunch
  #@apple_pie.save
end

step "the supplier is in :time_zone" do |time_zone|
  time_zone = ActiveSupport::TimeZone.zones_map[time_zone]
  raise "time zone #{time_zone} cannot be found" unless time_zone
  @supplier.time_zone = time_zone.name
  @supplier.save
end

step "the supplier has a night offset of :minutes minutes" do |minutes|
  @supplier.night_offset = minutes
  @supplier.save
end
