mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Merge pull request #3286 from luisramos0/2-0-order-spec
[Spree Upgrade] Fix specs in admin orders spec
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}
|
||||
|
||||
@@ -2396,6 +2396,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
payment_methods: "Payment Methods"
|
||||
payment_method_fee: "Transaction fee"
|
||||
payment_processing_failed: "Payment could not be processed, please check the details you entered"
|
||||
payment_updated: "Payment Updated"
|
||||
inventory_settings: "Inventory Settings"
|
||||
tag_rules: "Tag Rules"
|
||||
shop_preferences: "Shop Preferences"
|
||||
|
||||
@@ -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