mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Merge branch 'master' into product-amount-units
This commit is contained in:
@@ -29,6 +29,8 @@ feature %q{
|
||||
oc5 = create(:simple_order_cycle, name: '5',
|
||||
orders_open_at: 1.month.ago, orders_close_at: 2.weeks.ago)
|
||||
oc1 = create(:order_cycle, name: '1')
|
||||
oc0 = create(:simple_order_cycle, name: '0',
|
||||
orders_open_at: nil, orders_close_at: nil)
|
||||
|
||||
# When I go to the admin order cycles page
|
||||
login_to_admin_section
|
||||
@@ -36,9 +38,10 @@ feature %q{
|
||||
|
||||
# Then the order cycles should be ordered correctly
|
||||
page.all('#listing_order_cycles tr td:first-child').map(&:text).should ==
|
||||
['1', '2', '3', '4', '5', '6']
|
||||
['0', '1', '2', '3', '4', '5', '6']
|
||||
|
||||
# And the rows should have the correct classes
|
||||
page.should have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}.undated"
|
||||
page.should have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}.open"
|
||||
page.should have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}.open"
|
||||
page.should have_selector "#listing_order_cycles tr.order-cycle-#{oc3.id}.upcoming"
|
||||
@@ -47,7 +50,8 @@ feature %q{
|
||||
page.should have_selector "#listing_order_cycles tr.order-cycle-#{oc6.id}.closed"
|
||||
|
||||
# And I should see all the details for an order cycle
|
||||
within('table#listing_order_cycles tbody tr:first-child') do
|
||||
# (the table includes a hidden field between each row, making this nth-child(3) instead of 2)
|
||||
within('table#listing_order_cycles tbody tr:nth-child(3)') do
|
||||
# Then I should see the basic fields
|
||||
page.should have_selector 'a', text: oc1.name
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ feature %q{
|
||||
product = create(:simple_product, supplier: @supplier2)
|
||||
|
||||
click_link 'Products'
|
||||
within('#sub_nav') { click_link 'Products' }
|
||||
click_link product.name
|
||||
within('#sidebar') { click_link 'Product Distributions' }
|
||||
|
||||
|
||||
@@ -143,13 +143,12 @@ feature %q{
|
||||
table = rows.map { |r| r.all("th,td").map { |c| c.text.strip } }
|
||||
|
||||
table.sort.should == [
|
||||
["Supplier", "Product", "SKU", "Variant", "On Hand", "Price"],
|
||||
[product_1.supplier.name, "Product Name", variant_1.sku, "Size: Test", "10", "100.0"],
|
||||
[product_1.supplier.name, "Product Name", variant_2.sku, "Size: S", "20", "80.0"],
|
||||
[product_2.supplier.name, "Product 2", product_2.master.sku, "", "9", "99.0"]
|
||||
["Supplier", "Producer Suburb", "Product", "Product Properties", "Variant Value", "Price", "Group Buy Unit Quantity", "Amount"],
|
||||
[product_1.supplier.name, product_1.supplier.address.city, "Product Name", product_1.properties.join(", "), "Size: Test", "100.0", product_1.group_buy_unit_size.to_s, ""],
|
||||
[product_1.supplier.name, product_1.supplier.address.city, "Product Name", product_1.properties.join(", "), "Size: S", "80.0", product_1.group_buy_unit_size.to_s, ""],
|
||||
[product_2.supplier.name, product_1.supplier.address.city, "Product 2", product_1.properties.join(", "), "", "99.0", product_1.group_buy_unit_size.to_s, ""]
|
||||
].sort
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user