diff --git a/engines/order_management/app/controllers/order_management/reports/bulk_coop_controller.rb b/engines/order_management/app/controllers/order_management/reports/bulk_coop_controller.rb index 7bd86e83a2..c1810a92b6 100644 --- a/engines/order_management/app/controllers/order_management/reports/bulk_coop_controller.rb +++ b/engines/order_management/app/controllers/order_management/reports/bulk_coop_controller.rb @@ -46,8 +46,8 @@ module OrderManagement completed_at_gt: params[:report][:start_at], completed_at_lt: params[:report][:end_at], distributor_id_in: params[:report][:distributor_ids], - report_type: params[:report][:report_type] - } + }, + report_type: params[:report][:report_type] } end diff --git a/engines/order_management/spec/features/order_management/reports/bulk_coop_spec.rb b/engines/order_management/spec/features/order_management/reports/bulk_coop_spec.rb index 2cbc464c75..62181aebaf 100644 --- a/engines/order_management/spec/features/order_management/reports/bulk_coop_spec.rb +++ b/engines/order_management/spec/features/order_management/reports/bulk_coop_spec.rb @@ -6,11 +6,70 @@ feature "bulk coop" do include AuthenticationHelper include WebHelper - scenario "bulk co-op report" do - login_as_admin_and_visit spree.admin_reports_path - click_link 'Bulk Co-Op' + scenario "generating Bulk Coop Supplier Report" do + login_as_admin_and_visit new_order_management_reports_bulk_coop_path + select "Bulk Coop Supplier Report", from: "report_report_type" click_button 'Generate Report' - expect(page).to have_content 'Supplier' + expect(page).to have_table_row [ + "Supplier", + "Product", + "Bulk Unit Size", + "Variant", + "Variant Value", + "Variant Unit", + "Weight", + "Sum Total", + "Units Required", + "Unallocated", + "Max Quantity Excess" + ] + end + + scenario "generating Bulk Co-op Allocation report" do + login_as_admin_and_visit new_order_management_reports_bulk_coop_path + select "Bulk Coop Allocation", from: "report_report_type" + click_button 'Generate Report' + + expect(page).to have_table_row [ + "Customer", + "Product", + "Bulk Unit Size", + "Variant", + "Variant Value", + "Variant Unit", + "Weight", + "Sum Total", + "Total available", + "Unallocated", + "Max Quantity Excess" + ] + end + + scenario "generating Bulk Co-op Packing Sheets report" do + login_as_admin_and_visit new_order_management_reports_bulk_coop_path + select "Bulk Coop Packing Sheets", from: "report_report_type" + click_button 'Generate Report' + + expect(page).to have_table_row [ + "Customer", + "Product", + "Variant", + "Sum Total" + ] + end + + scenario "generating Bulk Co-op Customer Payments report" do + login_as_admin_and_visit new_order_management_reports_bulk_coop_path + select "Bulk Coop Customer Payments", from: "report_report_type" + click_button 'Generate Report' + + expect(page).to have_table_row [ + "Customer", + "Date of Order", + "Total Cost", + "Amount Owing", + "Amount Paid" + ] end end