Skip to content

Commit

Permalink
Improve OrdersHelper spec and delete dead code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matt-Yorkley committed Mar 7, 2021
1 parent 09f731d commit 1b97e65
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec/helpers/admin/orders_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@
let(:order) { create(:order) }

it "selects eligible adjustments" do
adjustment = create(:adjustment, adjustable: order, amount: 1)
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, adjustable: order, amount: 1, originator_type: "Spree::ShippingMethod")

expect(helper.order_adjustments_for_display(order)).to eq []
end

it "filters zero tax rate adjustments" do
create(:adjustment, adjustable: order, amount: 0, originator_type: "Spree::TaxRate")
create(:adjustment, order: order, adjustable: order, amount: 1, originator_type: "Spree::ShippingMethod")

expect(helper.order_adjustments_for_display(order)).to eq []
end
Expand Down

0 comments on commit 1b97e65

Please sign in to comment.