Make supplier product category spec work

This commit is contained in:
2013-12-16 11:38:38 +01:00
parent 85297bed4f
commit b1937f1e38
2 changed files with 19 additions and 1 deletions
@@ -32,3 +32,20 @@ step "the supplier clicks on the edit product category button" do
find('.edit-resource-button').click
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