Remove dead code Spree::Order#clear_adjustments

This commit is contained in:
Matt-Yorkley
2021-01-29 19:58:05 +00:00
parent b97734d918
commit fc06e5e4c3
2 changed files with 0 additions and 21 deletions

View File

@@ -534,11 +534,6 @@ module Spree
shipments.destroy_all
end
def clear_adjustments!
adjustments.destroy_all
line_item_adjustments.destroy_all
end
def state_changed(name)
state = "#{name}_state"
return unless persisted?

View File

@@ -5,22 +5,6 @@ require 'spec_helper'
describe Spree::Order do
let(:order) { Spree::Order.new }
context "clear_adjustments" do
let(:adjustment) { double("Adjustment") }
it "destroys all order adjustments" do
allow(order).to receive_messages(adjustments: adjustment)
expect(adjustment).to receive(:destroy_all)
order.clear_adjustments!
end
it "destroy all line item adjustments" do
allow(order).to receive_messages(line_item_adjustments: adjustment)
expect(adjustment).to receive(:destroy_all)
order.clear_adjustments!
end
end
context "totaling adjustments" do
let!(:adjustment1) { create(:adjustment, amount: 5) }
let!(:adjustment2) { create(:adjustment, amount: 10) }