File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed
promotions/spec/models/solidus_promotions/conditions Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ In-Memory Order Updater TODO
2929 - "This is really something which theoretically should be covered in tests"
3030
3131## Mar 28, 2025
32- - [ ] Verify if it is a breaking change to call
32+ - [x ] Verify if it is a breaking change to call
3333 ` LineItem#set_required_attributes ` in ` after_initialize ` instead of
3434 ` before_validation ` . We think this may be a breaking change that requires
35- further investigation.
35+ further investigation. (We investigated and don't believe it is a breaking change.)
Original file line number Diff line number Diff line change 1515 describe "#eligible?(line_item)" do
1616 subject { condition . eligible? ( line_item , { } ) }
1717
18- let ( :condition_line_item ) { Spree :: LineItem . new ( product : condition_product ) }
19- let ( :other_line_item ) { Spree :: LineItem . new ( product : other_product ) }
18+ let ( :condition_line_item ) { build ( :line_item , product : condition_product ) }
19+ let ( :other_line_item ) { build ( :line_item ) }
2020
2121 let ( :condition_options ) { super ( ) . merge ( products : [ condition_product ] ) }
22- let ( :condition_product ) { mock_model ( Spree ::Product , tax_category : nil ) }
23- let ( :other_product ) { mock_model ( Spree ::Product , tax_category : nil ) }
22+ let ( :condition_product ) { build ( :product ) }
2423
2524 it "is eligible if there are no products" do
2625 expect ( condition ) . to be_eligible ( condition_line_item )
Original file line number Diff line number Diff line change 188188 describe "#eligible?(line_item)" do
189189 subject { condition . eligible? ( line_item ) }
190190
191- let ( :condition_line_item ) { Spree :: LineItem . new ( product : condition_product ) }
192- let ( :other_line_item ) { Spree :: LineItem . new ( product : other_product ) }
191+ let ( :condition_line_item ) { build ( :line_item , product : condition_product ) }
192+ let ( :other_line_item ) { build ( :line_item ) }
193193
194194 let ( :condition_options ) { super ( ) . merge ( products : [ condition_product ] ) }
195- let ( :condition_product ) { mock_model ( Spree ::Product , tax_category : nil ) }
196- let ( :other_product ) { mock_model ( Spree ::Product , tax_category : nil ) }
195+ let ( :condition_product ) { build ( :product ) }
197196
198197 it "is eligible if there are no products" do
199198 expect ( condition ) . to be_eligible ( condition_line_item )
You can’t perform that action at this time.
0 commit comments