diff --git a/app/views/admin/reports/index.html.haml b/app/views/admin/reports/index.html.haml index d169ce1139..9ec68931fa 100644 --- a/app/views/admin/reports/index.html.haml +++ b/app/views/admin/reports/index.html.haml @@ -11,10 +11,10 @@ - @reports.each do |report_type, report_subtypes| %tr %td - - name = I18n.t(:name, scope: [:admin, :reports, report_type]) - - url = main_app.admin_report_url(report_type: report_type) - = link_to name, url + = I18n.t(:name, scope: [:admin, :reports, report_type]) %td - if report_subtypes.empty? - = I18n.t!(:description, scope: [:admin, :reports, report_type]) + - name = I18n.t(:name, scope: [:admin, :reports, report_type]) + - url = main_app.admin_report_url(report_type: report_type) + = link_to name, url = render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type } diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 676feedf41..a8a9f734b9 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -135,7 +135,7 @@ describe ' end it "generates the payments reports" do - click_link 'Payment Reports' + click_link 'Payments By Type' click_button 'Go' rows = find("table.report__table").all("thead tr") @@ -298,7 +298,7 @@ describe ' expect(page).to have_content "All products" expect(page).to have_content "Inventory (on hand)" - click_link 'Products & Inventory' + click_link 'All products' click_button "Go" expect(page).to have_content "Supplier" expect(page).to have_table_row ["Supplier", "Producer Suburb", "Product",