From 974099747bafc8d10f010219c7f553ad70c296f4 Mon Sep 17 00:00:00 2001 From: Julius Pabrinkis Date: Wed, 10 May 2017 19:20:34 +0100 Subject: [PATCH] Fix failing specs after text extraction --- config/locales/en.yml | 22 ++++++++++++------- lib/open_food_network/xero_invoices_report.rb | 6 ++++- spec/features/admin/reports_spec.rb | 7 +++--- .../order_and_distributor_report_spec.rb | 4 ++-- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index adf4bc24db..f49b21f3a9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -143,6 +143,8 @@ en: dashboard: Dashboard 'yes': "Yes" 'no': "No" + 'y': 'Y' + 'n': 'N' admin: # Common properties / models date: Date @@ -1583,7 +1585,7 @@ Please follow the instructions there to make your enterprise visible on the Open report_users: "Users: " report_tax_rates: Tax rates report_tax_types: Tax types - report_tax_type: Tax type + report_header_tax_type: Tax Type report_header_tracking_name_1: Tracking Name 1 report_header_tracking_name_2: Tracking Name 2 report_header_tracking_option_1: Tracking Option 1 @@ -1605,8 +1607,10 @@ Please follow the instructions there to make your enterprise visible on the Open report_header_billing_address: Billing Address report_header_relationship: Relationship report_header_hub: Hub + report_header_hub_address: Hub Address report_header_to_hub: To Hub - report_header_hub_code: Hub code + report_header_hub_code: Hub Code + report_header_code: Code report_header_paid: Paid? report_header_delivery: Delivery? report_header_shipping: Shipping @@ -1619,18 +1623,20 @@ Please follow the instructions there to make your enterprise visible on the Open report_header_ship_state: Ship State report_header_billing_street: Billing Street report_header_billing_street_2: Billing Street 2 + report_header_billing_street_3: Billing Street 3 + report_header_billing_street_4: Billing Street 4 report_header_billing_city: Billing City report_header_billing_postcode: Billing Postcode report_header_billing_region: Billing Region report_header_billing_state: Billing State report_header_billing_country: Billing Country report_header_incoming_transport: Incoming Transport - report_header_special_instructions: Special instructions + report_header_special_instructions: Special Instructions report_header_order_number: Order number - report_header_invoice_number: Invoice number + report_header_invoice_number: Invoice Number report_header_reference: Reference - report_header_invoice_date: Invoice date - report_header_due_date: Due date + report_header_invoice_date: Invoice Date + report_header_due_date: Due Date report_header_date: Date report_header_confirmation_date: Confirmation Date report_header_tags: Tags @@ -1663,7 +1669,7 @@ Please follow the instructions there to make your enterprise visible on the Open report_header_producer: Producer report_header_producer_suburb: Producer Suburb report_header_unit: Unit - report_header_group_buy_unit_quantity: Group by unit quantity + report_header_group_buy_unit_quantity: Group Buy Unit Quantity report_header_cost: Cost report_header_shipping_cost: Shipping Cost report_header_curr_cost_per_unit: Curr. Cost per Unit @@ -1715,7 +1721,7 @@ Please follow the instructions there to make your enterprise visible on the Open report_header_amount: Amount report_header_unit_amount: Unit Amount report_header_discount: Discount - report_header_account_code: Account code + report_header_account_code: Account Code report_header_balance: Balance report_header_total: Total report_header_total_cost: "Total Cost" diff --git a/lib/open_food_network/xero_invoices_report.rb b/lib/open_food_network/xero_invoices_report.rb index 0170cbd712..c549409256 100644 --- a/lib/open_food_network/xero_invoices_report.rb +++ b/lib/open_food_network/xero_invoices_report.rb @@ -16,6 +16,8 @@ module OpenFoodNetwork I18n.t(:report_header_email), I18n.t(:report_header_billing_street), I18n.t(:report_header_billing_street_2), + I18n.t(:report_header_billing_street_3), + I18n.t(:report_header_billing_street_4), I18n.t(:report_header_billing_city), I18n.t(:report_header_billing_region), I18n.t(:report_header_billing_postcode), @@ -153,6 +155,8 @@ module OpenFoodNetwork order.email, order.bill_address.andand.address1, order.bill_address.andand.address2, + '', + '', order.bill_address.andand.city, order.bill_address.andand.state, order.bill_address.andand.zipcode, @@ -174,7 +178,7 @@ module OpenFoodNetwork '', Spree::Config.currency, '', - order.paid? ? I18n.t(:yes) : I18n.t(:no) + order.paid? ? I18n.t(:y) : I18n.t(:n) ] end diff --git a/spec/features/admin/reports_spec.rb b/spec/features/admin/reports_spec.rb index 2a63d73216..31115c254b 100644 --- a/spec/features/admin/reports_spec.rb +++ b/spec/features/admin/reports_spec.rb @@ -315,8 +315,7 @@ feature %q{ page.should have_content "Inventory (on hand)" click_link 'Products & Inventory' page.should have_content "Supplier" - - page.should have_table_row ["Supplier", "Producer Suburb", "Product", "Product Properties", "Taxons", "Variant Value", "Price", "Group Buy Unit Quantity", "Amount", "SKU"].map(&:upcase) + page.should have_table_row ["Supplier", "Producer Suburb", "Product", "Product Properties", "Taxons", "Variant Value", "Price", "Group Buy Unit Quantity", "Amount", "SKU"].map(&:upcase) page.should have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), product1.primary_taxon.name, "Test", "100.0", product1.group_buy_unit_size.to_s, "", "sku1"] page.should have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), product1.primary_taxon.name, "Something", "80.0", product1.group_buy_unit_size.to_s, "", "sku2"] page.should have_table_row [product2.supplier.name, product1.supplier.address.city, "Product 2", product1.properties.map(&:presentation).join(", "), product2.primary_taxon.name, "100g", "99.0", product1.group_buy_unit_size.to_s, "", "product_sku"] @@ -511,7 +510,9 @@ feature %q{ end def xero_invoice_header - %w(*ContactName EmailAddress POAddressLine1 POAddressLine2 POAddressLine3 POAddressLine4 POCity PORegion POPostalCode POCountry *InvoiceNumber Reference *InvoiceDate *DueDate InventoryItemCode *Description *Quantity *UnitAmount Discount *AccountCode *TaxType TrackingName1 TrackingOption1 TrackingName2 TrackingOption2 Currency BrandingTheme Paid?) + ['*Contact Name', 'Email', 'Billing Street', 'Billing Street 2', 'Billing Street 3', 'Billing Street 4', 'Billing City', 'Billing Region', 'Billing Postcode', 'Billing Country', + '*Invoice Number', 'Reference', '*Invoice Date', '*Due Date', 'Inventory Item Code', '*Description', '*Quantity', '*Unit Amount', 'Discount', + '*Account Code', '*Tax Type', 'Tracking Name 1', 'Tracking Option 1', 'Tracking Name 2', 'Tracking Option 2', 'Currency', 'Branding Theme', 'Paid?'] end def xero_invoice_summary_row(description, amount, tax_type, opts={}) diff --git a/spec/lib/open_food_network/order_and_distributor_report_spec.rb b/spec/lib/open_food_network/order_and_distributor_report_spec.rb index e8759823db..5b96b20d75 100644 --- a/spec/lib/open_food_network/order_and_distributor_report_spec.rb +++ b/spec/lib/open_food_network/order_and_distributor_report_spec.rb @@ -28,8 +28,8 @@ module OpenFoodNetwork header = subject.header header.should == ["Order date", "Order Id", "Customer Name","Customer Email", "Customer Phone", "Customer City", - "SKU", "Item name", "Variant", "Quantity", "Max Quantity", "Cost", "Shipping cost", - "Payment method", + "SKU", "Item name", "Variant", "Quantity", "Max Quantity", "Cost", "Shipping Cost", + "Payment Method", "Distributor", "Distributor address", "Distributor city", "Distributor postcode", "Shipping instructions"] end