Fix list unit and supplier main board acceptance specs

This commit is contained in:
2014-05-28 15:16:08 +02:00
parent 4855b2e8e0
commit e9554ea3e7
14 changed files with 133 additions and 121 deletions
+5 -5
View File
@@ -205,10 +205,10 @@ class List
self.section_id = to_table.section_id
if save
# Update the section of an order
#orders.each do |order|
#order.section_id = self.section_id
#order.save
#end
orders.each do |order|
order.section_id = self.section_id
order.save
end
# user performs a client side refresh
broadcast_users 'list_changed_table', list_id: id #, from_table_id: from_table, to_table_id: to_table.id
broadcast_supplier supplier_id, 'list_changed_table', list: as_json, section_title: to_table.section.try(:title), from_table_id: from_table
@@ -288,7 +288,7 @@ class List
state == 'active'
end
def place_order(products, user: nil, employee: nil)
def place_order(products: {}, user: nil, employee: nil)
return false unless products.any?
order = Order.create list: self, supplier: supplier, user: user, employee: employee, section_id: section_id, table_id: table_id
return unless order.id