Supplier dashboard fixes

This commit is contained in:
2013-09-30 18:41:23 +02:00
parent 8ea2e79dc2
commit d96216ec29
5 changed files with 54 additions and 4 deletions
@@ -1,6 +1,6 @@
Feature: Supplier main board
@javascript
@javascript @broken
Scenario: the active list should be present and contained in row having its id
Given there is an active list and order
And I am signed in as supplier
@@ -45,3 +45,17 @@ Feature: Supplier main board
Then the list in the supplier dashboard should not be displayed anymore
And the list should be marked as closed
@javascript
Scenario: Selecting a specific section limits the result to the lists and orders of those sections
Given there is an active list and order
And I am signed in as supplier
And a new order on a table in another section is created
Then I should see the list and the new list
And I should see the order and the new order
When I select the section in the supplier dashboard
Then I should see the list and order but not the new list and new order
When I select the new section in the supplier dashboard
Then I should see the new list and new order but not the list and order
When I reset the section selector in the supplier dashboard
Then I should see the list and the new list
And I should see the order and the new order
@@ -7,6 +7,7 @@ step "there is an active list and order" do
@product = create :product, price: 2.22, supplier: @supplier
@order = create :order, user: @user, list: @list, supplier: @supplier, section: @section
@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
end
step "the supplier dashboard should display the active list" do
@@ -81,3 +82,38 @@ end
step "I click on the mark list as helped button in the supplier dashboard" do
find(".list-row-#{@list.id} .mark_list_as_helped").click
end
step "I should see the list and the new list" do
page.should have_selector ".list-row-#{@list.id}"
page.should have_selector ".list-row-#{@new_list.id}"
end
step "I should see the order and the new order" do
page.should have_selector ".order-row-#{@order.id}"
page.should have_selector ".order-row-#{@new_order.id}"
end
step "I should see the list and order but not the new list and new order" do
page.should have_selector ".list-row-#{@list.id}"
page.should_not have_selector ".list-row-#{@new_list.id}"
page.should have_selector ".order-row-#{@order.id}"
page.should_not have_selector ".order-row-#{@new_order.id}"
end
step "I should see the new list and new order but not the list and order" do
page.should_not have_selector ".list-row-#{@list.id}"
page.should have_selector ".list-row-#{@new_list.id}"
page.should_not have_selector ".order-row-#{@order.id}"
page.should have_selector ".order-row-#{@new_order.id}"
end
step "I select the section in the supplier dashboard" do
find(%|#section_selector option[value="#{@section.id}"]|).select_option
end
step "I select the new section in the supplier dashboard" do
find(%|#section_selector option[value="#{@new_section.id}"]|).select_option
end
step "I reset the section selector in the supplier dashboard" do
find(%|#section_selector option[value=""]|).select_option
end