From e290164b25f2ecb6280c0227f2b08f85cfc84a1d Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Tue, 3 Sep 2024 01:22:22 +0500 Subject: [PATCH] 12777: add specs --- spec/system/admin/invoice_print_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index 1709f934d0d..d03a9681d9a 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -300,6 +300,21 @@ expect(page).to have_content "Total (Excl. tax): $1,458.67" end end + + context "Line item with variant having variant_unit as 'items'" do + before do + line_item1.variant.update_columns(variant_unit: "items", display_as: "1 bucket") + login_as_admin + visit spree.print_admin_order_path(order1, params: url_params) + convert_pdf_to_page + end + + it 'should have correct display as value' do + # first line item + expect(page).to have_content Spree::Product.first.name.to_s + expect(page).to have_content "(1 bucket)" # display as + end + end end context "added" do