diff --git a/lib/solidus_paypal_braintree/factories.rb b/lib/solidus_paypal_braintree/factories.rb index cbf25c15..3b742690 100644 --- a/lib/solidus_paypal_braintree/factories.rb +++ b/lib/solidus_paypal_braintree/factories.rb @@ -1,11 +1,11 @@ -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: # require 'solidus_paypal_braintree/factories' end -FactoryGirl.modify do +FactoryBot.modify do # The Solidus address factory randomizes the zipcode. # The OrderWalkThrough we use in the credit card checkout spec uses this factory for the user addresses. # For credit card payments we transmit the billing address to braintree, for paypal payments the shipping address. diff --git a/solidus_paypal_braintree.gemspec b/solidus_paypal_braintree.gemspec index 46dde2df..3ca9bfc1 100644 --- a/solidus_paypal_braintree.gemspec +++ b/solidus_paypal_braintree.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'coffee-rails' s.add_development_dependency 'sass-rails' s.add_development_dependency 'database_cleaner' - s.add_development_dependency 'factory_girl' + s.add_development_dependency 'factory_bot' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'rubocop', '>= 0.47' s.add_development_dependency 'rubocop-rspec' diff --git a/spec/models/solidus_paypal_braintree/gateway_spec.rb b/spec/models/solidus_paypal_braintree/gateway_spec.rb index 77125858..40137d65 100644 --- a/spec/models/solidus_paypal_braintree/gateway_spec.rb +++ b/spec/models/solidus_paypal_braintree/gateway_spec.rb @@ -405,10 +405,10 @@ end shared_examples "sources_by_order" do - let(:order) { FactoryGirl.create :order, user: user, state: "complete", completed_at: Time.current } + let(:order) { FactoryBot.create :order, user: user, state: "complete", completed_at: Time.current } let(:gateway) { new_gateway.tap(&:save!) } - let(:other_payment_method) { FactoryGirl.create(:payment_method) } + let(:other_payment_method) { FactoryBot.create(:payment_method) } let(:source_without_profile) do SolidusPaypalBraintree::Source.create!( @@ -429,7 +429,7 @@ end end - let!(:source_payment) { FactoryGirl.create(:payment, order: order, payment_method_id: payment_method_id, source: source) } + let!(:source_payment) { FactoryBot.create(:payment, order: order, payment_method_id: payment_method_id, source: source) } context "when the order has payments with the braintree payment method" do let(:payment_method_id) { gateway.id } @@ -453,7 +453,7 @@ context "when the order has no payments with the braintree payment method" do let(:payment_method_id) { other_payment_method.id } - let(:source) { FactoryGirl.create :credit_card } + let(:source) { FactoryBot.create :credit_card } it "returns no results" do expect(subject.to_a).to eql([]) @@ -463,7 +463,7 @@ describe "#sources_by_order" do let(:gateway) { new_gateway.tap(&:save!) } - let(:order) { FactoryGirl.create :order, user: user, state: "complete", completed_at: Time.current } + let(:order) { FactoryBot.create :order, user: user, state: "complete", completed_at: Time.current } subject { gateway.sources_by_order(order) } @@ -471,7 +471,7 @@ end describe "#reusable_sources" do - let(:order) { FactoryGirl.build :order, user: user } + let(:order) { FactoryBot.build :order, user: user } let(:gateway) { new_gateway.tap(&:save!) } subject { gateway.reusable_sources(order) } @@ -482,7 +482,7 @@ context "when an order is not completed" do context "when the order has a user id" do - let(:user) { FactoryGirl.create(:user) } + let(:user) { FactoryBot.create(:user) } let!(:source_without_profile) do SolidusPaypalBraintree::Source.create!(