mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
Add 'Voucher:' before voucher code on edit cart page. Add spec correspondigly
This commit is contained in:
@@ -31,4 +31,28 @@ RSpec.describe "spree/orders/edit.html.haml" do
|
||||
expect(rendered).to have_selector(".unit-price")
|
||||
end
|
||||
end
|
||||
|
||||
describe "display adjustments" do
|
||||
let(:voucher) { create(:voucher, enterprise: order.distributor) }
|
||||
|
||||
before do
|
||||
voucher.create_adjustment(voucher.code, order)
|
||||
OrderManagement::Order::Updater.new(order).update_voucher
|
||||
render
|
||||
end
|
||||
|
||||
it "includes Voucher text with label" do
|
||||
expect(rendered).to include("Voucher: #{voucher.code}")
|
||||
end
|
||||
|
||||
# shipping fee is derived from 'completed_order_with_fees' factory, it applies when using shipping method such as Home Delivery.
|
||||
it "includes Shipping label" do
|
||||
expect(rendered).to include("Shipping")
|
||||
end
|
||||
|
||||
# transaction fee is derived from 'completed_order_with_fees' factory, it applies when using payment methods such as Check & Stripe.
|
||||
it "includes Transaction fee label" do
|
||||
expect(rendered).to include("Transaction fee")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user