Many supplier features and style upgrades and fixes

This commit is contained in:
2015-10-06 16:08:00 +02:00
parent b7a5b3b750
commit 2df5b290ef
50 changed files with 225 additions and 474 deletions
@@ -52,7 +52,7 @@ end
step "the supplier dashboard list should display the updated price" do
sleep 0.5
el = find(".list-row-#{@list.id} .total_list_amount")
el = find(".list-row-#{@list.id} .currency")
# original order is 3 * 2.11 = 6.33
# new order price = 5 * 2.22 = 11.10
# therefore the updated price should be 17.43
@@ -61,21 +61,21 @@ end
step "the new order should be present in the supplier dashboard" do
el = find(".order-row-#{@new_order.id}")
el.find('.table_number').text.should == @table.number.to_s
el.find('.section_title').text.should == @section.title
el.find('.table-number').text.should == "# #{@table.number}"
el.find('.link-to-section').text.should == @section.title
end
step "the new order on a table in another section should be present in the supplier dashboard" do
el = find(".order-row-#{@new_order.id}")
el.find('.table_number').text.should == @other_table.number.to_s
el.find('.section_title').text.should == @other_section.title
el.find('.table-number').text.should == "# #{@other_table.number}"
el.find('.link-to-section').text.should == @other_section.title
end
step "the new list should appear in the supplier dashboard" do
el = find(".list-row-#{@new_list.id}")
el.find('.total_list_amount').text.should =~ /6.66/
el.find('.section_title').text.should == @other_section.title
el.find('.table_number').text.should == @other_table.number.to_s
el.find('.currency').text.should =~ /6.66/
el.find('.link-to-section').text.should == @other_section.title
el.find('.table-number').text.should == "# #{@other_table.number}"
end
step "I click on the close list button in the supplier dashboard" do
@@ -133,13 +133,13 @@ step "the active list changes to another table in another section" do
end
step "the supplier main board table number should be updated to the new table number" do
expect( find(".list-row-#{@list.id} .table_number").text ).to eq "65"
expect( find(".order-row-#{@list.orders.first.id} .table_number").text ).to eq "65"
expect( find(".list-row-#{@list.id} .table-number").text ).to eq "# 65"
expect( find(".order-row-#{@list.orders.first.id} .table-number").text ).to eq "65"
end
step "the supplier main board section name should be updated to the new section" do
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"
expect( find(".list-row-#{@list.id} .link-to-section").text ).to eq "New Section"
expect( find(".order-row-#{@list.orders.first.id} .link-to-section").text ).to eq "New Section"
end
# Marking order as wrong
@@ -152,7 +152,7 @@ step "the supplier main board order should not be visible anymore" do
end
step "the supplier main board list total should be updated" do
find(".list-row-#{@list.id} .total_list_amount").text.should == "€ 0.00"
find(".list-row-#{@list.id} .currency").text.should == "€ 0.00"
end
step "the supplier placed orders counter should be reduced" do
@@ -23,7 +23,7 @@ step "the supplier emloyee sets the :attribute to :value in the employee popup"
end
step "the supplier emloyee clicks the active switch to deactivate the employee" do
js_click '.form-row.active .switch'
js_click '.form-row.active label'
end
step "the other employee should no longer be active for the current supplier" do
@@ -7,7 +7,12 @@ step "the supplier fills in the new product category form selecting not availabl
# default all days on, so click on tuesday deactivates it
within '.modal' do
js_set_field '.form-row.name input', 'New product category'
find('.form-row.tuesday .switch').click
find('.form-row.tuesday label').click
js_click '.toggle-full-day-button'
js_set_field '.select-start_from .hour-of-day select', '08'
js_set_field '.select-start_from .minute-of-hour select', '20'
js_set_field '.select-end_on .hour-of-day select', '12'
js_set_field '.select-end_on .minute-of-hour select', '30'
end
end
@@ -19,7 +24,9 @@ step "then new product category with proper properties should have been created"
sleep 1
@product_category = ProductCategory.find_by_name 'New product category'
#@product_category.week_days.should == [0, 0, 1, 0, 0, 0, 0]
@product_category.full_day.should be true
@product_category.full_day.should be false
@product_category.start_from.should be 500 # 8:20
@product_category.end_on.should be 750 # 12:30
expect( @product_category.active_on_monday ).to be true
expect( @product_category.active_on_tuesday ).to be false
expect( @product_category.active_on_wednesday ).to be true