diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 148e960e..0226f587 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -40,7 +40,7 @@ def quantity_by_variant private def update_inventory - if (changed? || target_shipment.present?) && + if (saved_changes? || target_shipment.present?) && order.has_checkout_step?("delivery") if product.assembly? OrderInventoryAssembly.new(self).verify(target_shipment) diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 960eddd3..0715453f 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -2,6 +2,7 @@ require 'capybara/rails' require 'capybara-screenshot/rspec' require 'selenium-webdriver' +require 'webdrivers' Capybara.register_driver :chrome do |app| Capybara::Selenium::Driver.new app, diff --git a/spree_product_assembly.gemspec b/spree_product_assembly.gemspec index 3a8e66ec..4522485d 100644 --- a/spree_product_assembly.gemspec +++ b/spree_product_assembly.gemspec @@ -28,6 +28,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'launchy' s.add_development_dependency 'pg', '~> 0.18' s.add_development_dependency 'selenium-webdriver' + s.add_development_dependency 'webdrivers' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'sass-rails' s.add_development_dependency 'simplecov'