Make supplier product category spec work
This commit is contained in:
@@ -11,8 +11,9 @@ Feature: Adding product category
|
|||||||
Then then new product category with proper properties linked to the first product should have been created
|
Then then new product category with proper properties linked to the first product should have been created
|
||||||
And the supplier should be on the product categoy overview path
|
And the supplier should be on the product categoy overview path
|
||||||
When the supplier clicks on the edit product category button
|
When the supplier clicks on the edit product category button
|
||||||
And the supplier unchecks the first product and checks the product
|
And the supplier unchecks the first product and checks the last product
|
||||||
And the supplier clicks on the tuesday and wednesday buttons selecting wednesday as active day
|
And the supplier clicks on the tuesday and wednesday buttons selecting wednesday as active day
|
||||||
And the supplier submits the product category form
|
And the supplier submits the product category form
|
||||||
|
Then the the product category is active on wednesday and only linked to the last product
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,3 +32,20 @@ step "the supplier clicks on the edit product category button" do
|
|||||||
find('.edit-resource-button').click
|
find('.edit-resource-button').click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
step "the supplier unchecks the first product and checks the last product" do
|
||||||
|
find("#product-checker-#{@products.first.id}").set false
|
||||||
|
find("#product-checker-#{@products.last.id}").set true
|
||||||
|
end
|
||||||
|
|
||||||
|
step "the supplier clicks on the tuesday and wednesday buttons selecting wednesday as active day" do
|
||||||
|
find('[data-day="tuesday"]').click
|
||||||
|
find('[data-day="wednesday"]').click
|
||||||
|
end
|
||||||
|
|
||||||
|
step "the the product category is active on wednesday and only linked to the last product" do
|
||||||
|
sleep 1
|
||||||
|
@product_category.reload
|
||||||
|
@product_category.week_days.should == [0, 0, 0, 1, 0, 0, 0]
|
||||||
|
@product_category.product_ids.should == [@products.last.id]
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user