Update ReportsController for background reports

As it turns out, the background reports were missing a small feature to
store user preferences. Yay specs!
This commit is contained in:
Maikel Linke
2023-11-30 13:51:32 +11:00
parent f28a8c87ab
commit bbe37e1392
3 changed files with 4 additions and 3 deletions

View File

@@ -26,6 +26,8 @@ module Admin
.enabled?(:background_reports, spree_current_user)
if @background_reports && request.post?
rendering_options # stores user preferences
return background(report_format)
end

View File

@@ -98,7 +98,6 @@ RSpec.configure do |config|
Flipper.disable(:background_reports) if example.file_path.in?(
[
# rubocop:disable Layout/LineLength
"./spec/controllers/admin/reports_controller_spec.rb",
"./spec/system/admin/reports/enterprise_fee_summaries_spec.rb",
"./spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb",
"./spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb",

View File

@@ -309,7 +309,7 @@ describe Admin::ReportsController, type: :controller do
controller_login_as_enterprise_user [coordinator1]
end
it 'renders the delivery report' do
it "triggers the delivery report" do
spree_post :show, {
q: { completed_at_lt: 1.day.ago },
shipping_method_in: ["123"], # We just need to search for shipping methods
@@ -317,7 +317,7 @@ describe Admin::ReportsController, type: :controller do
report_subtype: "delivery",
}
expect(response).to have_http_status(:ok)
expect(response).to have_http_status(:no_content)
end
end