Skip to content

Commit

Permalink
Fix broken variant weight assignment in spec
Browse files Browse the repository at this point in the history
OrderManagement::Stock::Packer builds a package with all the items
     Failure/Error: expect(package.weight).to be_positive
       expected `0.0 (#<BigDecimal:7f156c99fda8,'0.0',9(18)>).positive?` to be truthy, got false
     # ./engines/order_management/spec/services/order_management/stock/packer_spec.rb:19:in `block (2 levels) in <module:Stock>'
  • Loading branch information
Matt-Yorkley committed Nov 7, 2020
1 parent c785667 commit 4442557
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Stock

subject { Packer.new(stock_location, order) }

before { order.line_items.first.variant.update(weight: 1) }
before { order.line_items.first.variant.weight = 1 }

it 'builds a package with all the items' do
package = subject.package
Expand Down

0 comments on commit 4442557

Please sign in to comment.