mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user