mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Replace FactoryGirl with FactoryBot weverywhere
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :option_value, class: Spree::OptionValue do
|
||||
name 'Size'
|
||||
presentation 'S'
|
||||
|
||||
@@ -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|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :payment, class: Spree::Payment do
|
||||
transient do
|
||||
distributor {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :payment_method, class: Spree::PaymentMethod::Check do
|
||||
name 'Check'
|
||||
environment 'test'
|
||||
|
||||
@@ -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' }
|
||||
|
||||
@@ -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' }
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user