Test against unique fee name

The adjustment factory calls everything "Shipping" by default. This was
confusing here because we were explicitely looking at a non-shipping
fee.
This commit is contained in:
Maikel Linke
2022-08-11 16:30:34 +10:00
committed by Konrad
parent 77e644e3d4
commit 52843de1da

View File

@@ -131,7 +131,7 @@ describe CheckoutHelper, type: :helper do
let(:enterprise_fee) { create(:enterprise_fee, amount: 123) }
let!(:fee_adjustment) {
create(:adjustment, originator: enterprise_fee, adjustable: order,
order: order)
order: order, label: "Enterprise Fee")
}
before do
@@ -148,7 +148,7 @@ describe CheckoutHelper, type: :helper do
expect(adjustments).to include shipping_adjustment
admin_fee_summary = adjustments.reject { |a| a.id == shipping_adjustment.id }.first
expect(admin_fee_summary.label).to eq "Shipping"
expect(admin_fee_summary.label).to eq "Enterprise Fee"
expect(admin_fee_summary.amount).to eq 123
end