Add supplier info popup
This commit is contained in:
@@ -113,3 +113,19 @@ step "the user has an older list for the same supplier" do
|
||||
@older_list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
|
||||
|
||||
end
|
||||
|
||||
step "the user has an active list with a/an :order_status order" do |order_status|
|
||||
@list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
|
||||
@product_category ||= create :product_category, supplier: @supplier
|
||||
@product ||= create :product, supplier: @supplier, name: 'Beer', price: 2.34, product_category: @product_category
|
||||
@order = create :order, order_status.to_sym, supplier: @supplier, list: @list, user: @user
|
||||
@product_order = create :product_order, order: @order, product: @product, quantity: 2, price: 2.34
|
||||
@user.reload
|
||||
@user.active_list_id = @list.id
|
||||
@user.save
|
||||
case order_status.to_sym
|
||||
when :placed then @supplier.increment_orders_placed_count!
|
||||
when :active then @supplier.increment_orders_in_process_count!
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
step "the user clicks on the table number info in the top right corner" do
|
||||
find('.top-menu .table-number').click
|
||||
end
|
||||
|
||||
step "the user sees the supplier information popup" do
|
||||
within '.modal' do
|
||||
page.should have_content @supplier.name
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user