mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
The removed test here was checking for adjustments that have an amount of zero and are eligible. If the amount is zero, it will already be marked as ineligible.
29 lines
895 B
Ruby
29 lines
895 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "spec_helper"
|
|
|
|
describe Admin::OrdersHelper, type: :helper do
|
|
describe "#order_adjustments_for_display" do
|
|
let(:order) { create(:order) }
|
|
|
|
it "selects eligible adjustments" do
|
|
adjustment = create(:adjustment, order: order, adjustable: order, amount: 1)
|
|
|
|
expect(helper.order_adjustments_for_display(order)).to eq [adjustment]
|
|
end
|
|
|
|
it "filters shipping method adjustments" do
|
|
create(:adjustment, order: order, adjustable: order, amount: 1, originator_type: "Spree::ShippingMethod")
|
|
|
|
expect(helper.order_adjustments_for_display(order)).to eq []
|
|
end
|
|
|
|
it "filters ineligible adjustments" do
|
|
create(:adjustment, adjustable: order, amount: 0, eligible: false,
|
|
originator_type: "Spree::TaxRate")
|
|
|
|
expect(helper.order_adjustments_for_display(order)).to eq []
|
|
end
|
|
end
|
|
end
|