Replace FactoryGirl with FactoryBot weverywhere

This commit is contained in:
Luis Ramos
2020-08-23 13:31:49 +01:00
parent 53a8fec181
commit 4ac6664502
8 changed files with 8 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ class TestCard < Spree::CreditCard
def remove_readonly_attributes(attributes) attributes; end
end
FactoryGirl.define do
FactoryBot.define do
factory :credit_card, class: TestCard do
verification_value 123
month 12

View File

@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :option_value, class: Spree::OptionValue do
name 'Size'
presentation 'S'

View File

@@ -108,7 +108,7 @@ FactoryBot.modify do
trait :with_line_item do
transient do
variant { FactoryGirl.create(:variant) }
variant { FactoryBot.create(:variant) }
end
after(:create) do |order, evaluator|

View File

@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :payment, class: Spree::Payment do
transient do
distributor {

View File

@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :payment_method, class: Spree::PaymentMethod::Check do
name 'Check'
environment 'test'

View File

@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :shipping_category, class: Spree::ShippingCategory do
initialize_with { DefaultShippingCategory.find_or_create }
transient { name 'Default' }

View File

@@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :stock_location, class: Spree::StockLocation do
# Ensures the name attribute is not assigned after instantiating the default location
transient { name 'default' }

View File

@@ -63,7 +63,7 @@ describe Spree::Order do
end
it "transitions to address" do
order.line_items << FactoryGirl.create(:line_item)
order.line_items << FactoryBot.create(:line_item)
order.email = "user@example.com"
order.next!
expect(order.state).to eq "address"