Add a blank row after summary row in all reports

This commit is contained in:
Rohan Mitchell
2015-07-23 13:44:23 +10:00
parent 8ee467d2b9
commit b0dd765181
2 changed files with 7 additions and 6 deletions

View File

@@ -31,10 +31,11 @@ module OpenFoodNetwork
rows = []
unless is_leaf_node(groups)
groups.each do |key, group|
unless key == :summary_row
build_table(group).each { |g| rows << g }
else
if key == :summary_row
rows << group[:columns].map { |cols| cols.call(group[:items]) }
rows << Array.new(group[:columns].count, '')
else
build_table(group).each { |g| rows << g }
end
end
else

View File

@@ -124,7 +124,7 @@ feature %q{
table.sort.should == [
["Hub", "Code", "First Name", "Last Name", "Supplier", "Product", "Variant", "Quantity", "TempControlled?"]
].sort
all('table#listing_orders tbody tr').count.should == 5 # Totals row per order
all('table#listing_orders tbody tr').count.should == 7 # Totals row per order
end
scenario "Pack By Supplier" do
@@ -139,7 +139,7 @@ feature %q{
table.sort.should == [
["Hub", "Supplier", "Code", "First Name", "Last Name", "Product", "Variant", "Quantity", "TempControlled?"]
].sort
all('table#listing_orders tbody tr').count.should == 4 # Totals row per supplier
all('table#listing_orders tbody tr').count.should == 5 # Totals row per supplier
end
end
@@ -266,7 +266,7 @@ feature %q{
click_button 'Search'
# Then I should see the rows for the first order but not the second
all('table#listing_orders tbody tr').count.should == 2 # Two rows per order
all('table#listing_orders tbody tr').count.should == 3 # Three rows per order
end
end