Skip to content

Commit fc5b38b

Browse files
committed
Remove benefit modules
1 parent 6e8ec6f commit fc5b38b

File tree

5 files changed

+13
-49
lines changed

5 files changed

+13
-49
lines changed

promotions/app/models/concerns/solidus_promotions/benefits/line_item_benefit.rb

Lines changed: 0 additions & 16 deletions
This file was deleted.

promotions/app/models/concerns/solidus_promotions/benefits/order_benefit.rb

Lines changed: 0 additions & 16 deletions
This file was deleted.

promotions/app/models/concerns/solidus_promotions/benefits/shipment_benefit.rb

Lines changed: 0 additions & 16 deletions
This file was deleted.

promotions/app/models/solidus_promotions/benefits/create_discounted_item.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module SolidusPromotions
44
module Benefits
55
class CreateDiscountedItem < Benefit
6-
include OrderBenefit
76
preference :variant_id, :integer
87
preference :quantity, :integer, default: 1
98
preference :necessary_quantity, :integer, default: 1
@@ -19,6 +18,11 @@ def remove_from(order)
1918
order.line_items.destroy(line_item)
2019
end
2120

21+
def level
22+
:order
23+
end
24+
deprecate :level, deprecator: Spree.deprecator
25+
2226
private
2327

2428
def discount_line_item(line_item, ...)

promotions/spec/models/solidus_promotions/benefits/create_discounted_item_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
RSpec.describe SolidusPromotions::Benefits::CreateDiscountedItem do
66
it { is_expected.to respond_to(:preferred_variant_id) }
77

8+
describe "can_discount?" do
9+
let(:discountable) { Spree::LineItem.new }
10+
11+
subject { described_class.new.can_discount?(discountable)}
12+
13+
it { is_expected.to be false }
14+
end
15+
816
describe "#perform" do
917
let(:order) { create(:order_with_line_items) }
1018
let(:promotion) { create(:solidus_promotion) }

0 commit comments

Comments
 (0)