mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix admin orders spec by adapting the spec to the recently de-defaced page
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user