End of day commit
This commit is contained in:
@@ -5,9 +5,11 @@ step "there is an active list and order" do
|
||||
@section.should be_present
|
||||
@list = create :list, state: 'active', supplier: @supplier, table: @table, section: @section, user_ids: [@user.id]
|
||||
@product = create :product, price: 2.22, supplier: @supplier
|
||||
@order = create :order, user: @user, list: @list, supplier: @supplier, section: @section
|
||||
@order = create :order, user: @user, list: @list, supplier: @supplier, section: @section, state: 'placed'
|
||||
@product_order = create :product_order, order: @order, product: @product, quantity: 3, price: 2.11
|
||||
@list.set_price.should == 6.33 # does not belong here, but good test. must take product order price above product price
|
||||
Qwaiter::Counter.set "supplier_counter:#{@supplier.id}:orders_placed", 11
|
||||
Qwaiter::Counter.set "supplier_counter:#{@supplier.id}:orders_in_process", 7
|
||||
end
|
||||
|
||||
step "the supplier dashboard should display the active list" do
|
||||
@@ -142,3 +144,23 @@ step "the supplier main board section name should be updated to the new section"
|
||||
expect( find(".list-row-#{@list.id} .section_title").text ).to eq "New Section"
|
||||
expect( find(".order-row-#{@list.orders.first.id} .section_title").text ).to eq "New Section"
|
||||
end
|
||||
|
||||
# Marking order as wrong
|
||||
step "the supplier marks the order as wrong in the main board view" do
|
||||
find(".order-row-#{@order.id} .remove-order").click
|
||||
end
|
||||
|
||||
step "the supplier main board order should not be visible anymore" do
|
||||
page.should_not have_selector ".order-row-#{@order.id}"
|
||||
end
|
||||
|
||||
step "the supplier main board list total should be updated" do
|
||||
find(".list-row-#{@list.id} .total_list_amount").text.should == "€ 0.00"
|
||||
end
|
||||
|
||||
step "the supplier placed orders counter should be reduced" do
|
||||
sleep 0.5
|
||||
binding.pry
|
||||
puts page.driver.error_messages
|
||||
find('.supplier-orders-placed-count-number').text.should == "10"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user