From bdefc0ebd1d15ea8a37e5ea677aef8162e652488 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Sun, 6 Jan 2019 13:01:11 +0000 Subject: [PATCH] Fix admin orders spec by adapting the spec to the recently de-defaced page --- .../spree/admin/orders/_line_item.html.haml | 4 ++-- spec/features/admin/orders_spec.rb | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/views/spree/admin/orders/_line_item.html.haml b/app/views/spree/admin/orders/_line_item.html.haml index 9afed0e2ec..b1164c1667 100644 --- a/app/views/spree/admin/orders/_line_item.html.haml +++ b/app/views/spree/admin/orders/_line_item.html.haml @@ -3,10 +3,10 @@ = f.object.variant.product.name = "(#{f.object.full_name})" unless f.object.variant.option_values.empty? %td.price.align-center - = f.object.variant.display_amount + = f.object.single_display_amount %td.qty = f.number_field :quantity, min: 0, class: "qty" %td.total.align-center - = f.object.single_money + = f.object.display_amount %td.actions = link_to_delete f.object, {url: admin_order_line_item_url(@order.number, f.object), no_text: true} diff --git a/spec/features/admin/orders_spec.rb b/spec/features/admin/orders_spec.rb index 1c4aa80a74..9af1b8a84a 100644 --- a/spec/features/admin/orders_spec.rb +++ b/spec/features/admin/orders_spec.rb @@ -230,13 +230,19 @@ feature %q{ within('table.index tbody', match: :first) do @order.line_items.each do |item| expect(page).to have_selector "td", match: :first, text: item.full_name - expect(page).to have_selector "td.item-price", text: item.single_display_amount - expect(page).to have_selector "td.item-qty-show", text: item.quantity - expect(page).to have_selector "td.item-total", text: item.display_amount + expect(page).to have_selector "td.price", text: item.single_display_amount + expect(page).to have_selector "input.qty[value='#{item.quantity}']" + expect(page).to have_selector "td.total", text: item.display_amount end end end + scenario "shows the order subtotal" do + within('table.index tbody#subtotal') do + expect(page).to have_selector "td.total", text: @order.display_item_total + end + end + scenario "shows the order charges (non-tax adjustments)" do within('tbody#order-charges') do @order.adjustments.eligible.each do |adjustment| @@ -248,8 +254,8 @@ feature %q{ end scenario "shows the order total" do - within('fieldset#order-total') do - expect(page).to have_selector "span.order-total", text: @order.display_total + within('table.index tbody#order-total') do + expect(page).to have_selector "td.total", text: @order.display_total end end @@ -263,11 +269,9 @@ feature %q{ scenario "shows the dropdown menu" do find("#links-dropdown .ofn-drop-down").click within "#links-dropdown" do - expect(page).to have_link "Edit", href: spree.edit_admin_order_path(@order) expect(page).to have_link "Resend Confirmation", href: spree.resend_admin_order_path(@order) expect(page).to have_link "Send Invoice", href: spree.invoice_admin_order_path(@order) expect(page).to have_link "Print Invoice", href: spree.print_admin_order_path(@order) - # expect(page).to have_link "Ship Order", href: spree.fire_admin_order_path(@order, :e => 'ship') expect(page).to have_link "Cancel Order", href: spree.fire_admin_order_path(@order, :e => 'cancel') end end