From 4c8fbce0db1c4ebb87fbee87b85ab2795c1709d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 5 Oct 2018 14:54:49 +0200 Subject: [PATCH 1/2] Update FactoryGirl to FactoryBot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/solidus_mailchimp_sync/factories.rb | 4 ++-- solidus_mailchimp_sync.gemspec | 2 +- spec/spec_helper.rb | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/solidus_mailchimp_sync/factories.rb b/lib/solidus_mailchimp_sync/factories.rb index 28b7517..53ab2a5 100644 --- a/lib/solidus_mailchimp_sync/factories.rb +++ b/lib/solidus_mailchimp_sync/factories.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them. # # Example adding this to your spec_helper will load these Factories for use: @@ -6,7 +6,7 @@ end -FactoryGirl.modify do +FactoryBot.modify do factory :order do factory :order_with_line_items do # This custom factory is from Solidus master at: diff --git a/solidus_mailchimp_sync.gemspec b/solidus_mailchimp_sync.gemspec index fea97e1..63f71b8 100644 --- a/solidus_mailchimp_sync.gemspec +++ b/solidus_mailchimp_sync.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'coffee-rails', '~> 4.2' s.add_development_dependency 'sass-rails', '~> 5.0' s.add_development_dependency 'database_cleaner', '~> 1.5' - s.add_development_dependency 'factory_girl', '~> 4.7' + s.add_development_dependency 'factory_bot', '~> 4.11' s.add_development_dependency 'rspec-rails', '~> 3.5' s.add_development_dependency 'rubocop', '~> 0.44' s.add_development_dependency 'rubocop-rspec', '~> 1.8' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1458c70..0ece3aa 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,7 +17,6 @@ require 'rspec/rails' require 'database_cleaner' -require 'ffaker' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. @@ -58,7 +57,7 @@ end RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods # Infer an example group's spec type from the file location. config.infer_spec_type_from_file_location! From e513f5ef53ff3a128052de9a40b70b57d20ea6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 5 Oct 2018 14:54:27 +0200 Subject: [PATCH 2/2] Fix an error in ImageDecorator where 'variant' is passed instead of 'viewable' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/solidus_decorators/spree/image_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/solidus_decorators/spree/image_decorator.rb b/app/solidus_decorators/spree/image_decorator.rb index 939d741..4dd3353 100644 --- a/app/solidus_decorators/spree/image_decorator.rb +++ b/app/solidus_decorators/spree/image_decorator.rb @@ -9,7 +9,7 @@ def mailchimp_sync SolidusMailchimpSync::ProductSynchronizer.new(self.viewable.product).auto_sync(force: true) else # image just on this variant, just need to sync this one. - SolidusMailchimpSync::VariantSynchronizer.new(self.variant).auto_sync(force: true) + SolidusMailchimpSync::VariantSynchronizer.new(self.viewable).auto_sync(force: true) end end end