spree_core 3.2.7 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/spree/payment/processing.rb +2 -2
  3. data/app/models/spree/promotion/rules/option_value.rb +5 -13
  4. data/app/models/spree/refund.rb +1 -1
  5. data/app/validators/db_maximum_length_validator.rb +5 -1
  6. data/lib/spree/core/engine.rb +3 -3
  7. data/lib/spree/core/version.rb +1 -1
  8. data/lib/spree/money.rb +15 -1
  9. data/lib/spree/testing_support/factories.rb +3 -3
  10. data/lib/spree/testing_support/factories/address_factory.rb +1 -1
  11. data/lib/spree/testing_support/factories/adjustment_factory.rb +1 -1
  12. data/lib/spree/testing_support/factories/calculator_factory.rb +1 -1
  13. data/lib/spree/testing_support/factories/country_factory.rb +1 -1
  14. data/lib/spree/testing_support/factories/credit_card_factory.rb +1 -1
  15. data/lib/spree/testing_support/factories/customer_return_factory.rb +1 -1
  16. data/lib/spree/testing_support/factories/image_factory.rb +1 -1
  17. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +1 -1
  18. data/lib/spree/testing_support/factories/line_item_factory.rb +1 -1
  19. data/lib/spree/testing_support/factories/options_factory.rb +1 -1
  20. data/lib/spree/testing_support/factories/order_factory.rb +1 -1
  21. data/lib/spree/testing_support/factories/payment_factory.rb +1 -1
  22. data/lib/spree/testing_support/factories/payment_method_factory.rb +1 -1
  23. data/lib/spree/testing_support/factories/price_factory.rb +1 -1
  24. data/lib/spree/testing_support/factories/product_factory.rb +1 -1
  25. data/lib/spree/testing_support/factories/product_option_type_factory.rb +1 -1
  26. data/lib/spree/testing_support/factories/product_property_factory.rb +1 -1
  27. data/lib/spree/testing_support/factories/promotion_category_factory.rb +1 -1
  28. data/lib/spree/testing_support/factories/promotion_factory.rb +1 -1
  29. data/lib/spree/testing_support/factories/promotion_rule_factory.rb +1 -1
  30. data/lib/spree/testing_support/factories/property_factory.rb +1 -1
  31. data/lib/spree/testing_support/factories/prototype_factory.rb +1 -1
  32. data/lib/spree/testing_support/factories/refund_factory.rb +1 -1
  33. data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
  34. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +1 -1
  35. data/lib/spree/testing_support/factories/return_authorization_factory.rb +1 -1
  36. data/lib/spree/testing_support/factories/return_item_factory.rb +1 -1
  37. data/lib/spree/testing_support/factories/role_factory.rb +1 -1
  38. data/lib/spree/testing_support/factories/shipment_factory.rb +1 -1
  39. data/lib/spree/testing_support/factories/shipping_category_factory.rb +1 -1
  40. data/lib/spree/testing_support/factories/shipping_method_factory.rb +1 -1
  41. data/lib/spree/testing_support/factories/state_factory.rb +1 -1
  42. data/lib/spree/testing_support/factories/stock_factory.rb +1 -1
  43. data/lib/spree/testing_support/factories/stock_item_factory.rb +1 -1
  44. data/lib/spree/testing_support/factories/stock_location_factory.rb +1 -1
  45. data/lib/spree/testing_support/factories/stock_movement_factory.rb +1 -1
  46. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +1 -1
  47. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +1 -1
  48. data/lib/spree/testing_support/factories/store_credit_factory.rb +1 -1
  49. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +1 -1
  50. data/lib/spree/testing_support/factories/store_factory.rb +1 -1
  51. data/lib/spree/testing_support/factories/tag_factory.rb +1 -1
  52. data/lib/spree/testing_support/factories/tax_category_factory.rb +1 -1
  53. data/lib/spree/testing_support/factories/tax_rate_factory.rb +1 -1
  54. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  55. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  56. data/lib/spree/testing_support/factories/tracker_factory.rb +1 -1
  57. data/lib/spree/testing_support/factories/user_factory.rb +1 -1
  58. data/lib/spree/testing_support/factories/variant_factory.rb +1 -1
  59. data/lib/spree/testing_support/factories/zone_factory.rb +1 -1
  60. data/lib/spree/testing_support/factories/zone_member_factory.rb +1 -1
  61. data/lib/spree/testing_support/order_walkthrough.rb +9 -9
  62. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b966f0b41c17b1b0397491803b4f3f475f472375
4
- data.tar.gz: bf70f58208a09a564a5b337b3a2b84cad71e27d3
3
+ metadata.gz: 5784e0221c1f448f4682cf059247c3e9d01ad19b
4
+ data.tar.gz: dd80c5de85ebe27ba574f29e33d35c816c600b8d
5
5
  SHA512:
6
- metadata.gz: acbd6dd076a001da65ed6bb6340e5670ff6169884ebb44941eebed7659dbbadea45589e568d6d7e0660a88b2272f77a50bb8543a933496772ecceda61f95bb67
7
- data.tar.gz: 32694d53a8ef20c28199bc571e9a8ebd3b5a153a69b7fa4e5c87522e6aa0e1c9a59724c03e663ce0935d9a5bdda09ba945b909032358ac614f19feeaaf7a2c2f
6
+ metadata.gz: b7582fc9f404c240605ba0e75594a154c3318e3388fe4bf50bfb1c5d7474ecfd8021afa9cc182b1c2c07ecdf3c0eb9f87fe4e34ffde5155579a03947ca27410b
7
+ data.tar.gz: 647cdecd05511282ebbd7c8233cdc76e3abcc261492a1791f4799c38193f728b15bb89e4acd725b371b75e9d197abdb157ebb635e8599fd1de0e0a545383ced0
@@ -29,7 +29,7 @@ module Spree
29
29
  # a new pending payment record for the remaining amount to capture later.
30
30
  def capture!(amount = nil)
31
31
  return true if completed?
32
- amount ||= money.money.cents
32
+ amount ||= money.amount_in_cents
33
33
  started_processing!
34
34
  protect_from_connection_error do
35
35
  # Standard ActiveMerchant capture usage
@@ -115,7 +115,7 @@ module Spree
115
115
 
116
116
  def gateway_action(source, action, success_state)
117
117
  protect_from_connection_error do
118
- response = payment_method.send(action, money.money.cents,
118
+ response = payment_method.send(action, money.amount_in_cents,
119
119
  source,
120
120
  gateway_options)
121
121
  handle_response(response, success_state, :failure)
@@ -31,20 +31,12 @@ module Spree
31
31
  end
32
32
 
33
33
  def actionable?(line_item)
34
- pid = line_item.product.id
35
- ovids = line_item.variant.option_values.pluck(:id)
34
+ product_id = line_item.product.id
35
+ option_values_ids = line_item.variant.option_value_ids
36
+ eligible_product_ids = preferred_eligible_values.keys
37
+ eligible_value_ids = preferred_eligible_values[product_id]
36
38
 
37
- product_ids.include?(pid) && (value_ids(pid) - ovids).empty?
38
- end
39
-
40
- private
41
-
42
- def product_ids
43
- preferred_eligible_values.keys
44
- end
45
-
46
- def value_ids(product_id)
47
- preferred_eligible_values[product_id]
39
+ eligible_product_ids.include?(product_id) && (eligible_value_ids & option_values_ids).present?
48
40
  end
49
41
  end
50
42
  end
@@ -43,7 +43,7 @@ module Spree
43
43
  def perform!
44
44
  return true if transaction_id.present?
45
45
 
46
- credit_cents = Spree::Money.new(amount.to_f, currency: payment.currency).money.cents
46
+ credit_cents = Spree::Money.new(amount.to_f, currency: payment.currency).amount_in_cents
47
47
 
48
48
  @response = process!(credit_cents)
49
49
 
@@ -2,7 +2,11 @@
2
2
  # Validates a field based on the maximum length of the underlying DB field, if there is one.
3
3
  class DbMaximumLengthValidator < ActiveModel::EachValidator
4
4
  def validate_each(record, attribute, value)
5
- limit = record.class.columns_hash[attribute.to_s].limit
5
+ if defined?(Globalize)
6
+ limit = record.class.translation_class.columns_hash[attribute.to_s].limit
7
+ else
8
+ limit = record.class.columns_hash[attribute.to_s].limit
9
+ end
6
10
  value = record[attribute.to_sym]
7
11
  if value && limit && value.to_s.length > limit
8
12
  record.errors.add(attribute.to_sym, :too_long, count: limit)
@@ -116,12 +116,12 @@ module Spree
116
116
  end
117
117
 
118
118
  config.to_prepare do
119
- # Load spree locales before decorators
120
- I18n.load_path += Dir.glob(
119
+ # Ensure spree locale paths are present before decorators
120
+ I18n.load_path.unshift(*(Dir.glob(
121
121
  File.join(
122
122
  File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
123
123
  )
124
- )
124
+ ) - I18n.load_path))
125
125
 
126
126
  # Load application's model / class decorators
127
127
  Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.2.7"
3
+ "3.2.8"
4
4
  end
5
5
  end
data/lib/spree/money.rb CHANGED
@@ -15,13 +15,17 @@ module Spree
15
15
 
16
16
  attr_reader :money
17
17
 
18
- delegate :cents, to: :money
18
+ delegate :cents, :currency, to: :money
19
19
 
20
20
  def initialize(amount, options={})
21
21
  @money = Monetize.parse([amount, (options[:currency] || Spree::Config[:currency])].join)
22
22
  @options = Spree::Money.default_formatting_rules.merge(options)
23
23
  end
24
24
 
25
+ def amount_in_cents
26
+ (cents / currency.subunit_to_unit.to_f * 100).round
27
+ end
28
+
25
29
  def to_s
26
30
  @money.format(@options)
27
31
  end
@@ -40,6 +44,16 @@ module Spree
40
44
  to_s
41
45
  end
42
46
 
47
+ def decimal_mark
48
+ return @money.decimal_mark if @options[:decimal_mark].nil?
49
+ @options[:decimal_mark]
50
+ end
51
+
52
+ def thousands_separator
53
+ return @money.thousands_separator if @options[:thousands_separator].nil?
54
+ @options[:thousands_separator]
55
+ end
56
+
43
57
  def ==(obj)
44
58
  @money == obj.money
45
59
  end
@@ -1,8 +1,8 @@
1
- require 'factory_girl'
1
+ require 'factory_bot'
2
2
 
3
3
  Spree::Zone.class_eval do
4
4
  def self.global
5
- find_by(name: 'GlobalZone') || FactoryGirl.create(:global_zone)
5
+ find_by(name: 'GlobalZone') || FactoryBot.create(:global_zone)
6
6
  end
7
7
  end
8
8
 
@@ -10,7 +10,7 @@ Dir["#{File.dirname(__FILE__)}/factories/**"].each do |f|
10
10
  load File.expand_path(f)
11
11
  end
12
12
 
13
- FactoryGirl.define do
13
+ FactoryBot.define do
14
14
  sequence(:random_string) { FFaker::Lorem.sentence }
15
15
  sequence(:random_description) { FFaker::Lorem.paragraphs(1 + Kernel.rand(5)).join("\n") }
16
16
  sequence(:random_email) { FFaker::Internet.email }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :address, aliases: [:bill_address, :ship_address], class: Spree::Address do
3
3
  firstname 'John'
4
4
  lastname 'Doe'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :adjustment, class: Spree::Adjustment do
3
3
  association(:adjustable, factory: :order)
4
4
  amount 100.0
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :calculator, class: Spree::Calculator::FlatRate do
3
3
  after(:create) { |c| c.set_preference(:amount, 10.0) }
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :country, class: Spree::Country do
3
3
  sequence(:iso_name) { |n| "ISO_NAME_#{n}" }
4
4
  sequence(:name) { |n| "NAME_#{n}" }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :credit_card, class: Spree::CreditCard do
3
3
  verification_value 123
4
4
  month 12
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :customer_return, class: Spree::CustomerReturn do
4
4
  association(:stock_location, factory: :stock_location)
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :image, class: Spree::Image do
3
3
  attachment { File.new(Spree::Core::Engine.root + "spec/fixtures" + 'thinking-cat.jpg') }
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :inventory_unit, class: Spree::InventoryUnit do
3
3
  variant
4
4
  order
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :line_item, class: Spree::LineItem do
3
3
  quantity 1
4
4
  price { BigDecimal.new('10.00') }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :option_value, class: Spree::OptionValue do
3
3
  sequence(:name) { |n| "Size-#{n}" }
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :order, class: Spree::Order do
3
3
  user
4
4
  bill_address
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :payment, class: Spree::Payment do
3
3
  amount 45.75
4
4
  association(:payment_method, factory: :credit_card_payment_method)
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :check_payment_method, class: Spree::PaymentMethod::Check do
3
3
  name 'Check'
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :price, class: Spree::Price do
3
3
  variant
4
4
  amount 19.99
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :base_product, class: Spree::Product do
3
3
  sequence(:name) { |n| "Product ##{n} - #{Kernel.rand(9999)}" }
4
4
  description { generate(:random_description) }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :product_option_type, class: Spree::ProductOptionType do
3
3
  product
4
4
  option_type
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :product_property, class: Spree::ProductProperty do
3
3
  product
4
4
  property
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :promotion_category, class: Spree::PromotionCategory do
3
3
  name 'Promotion Category'
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :promotion, class: Spree::Promotion do
3
3
  name 'Promo'
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :promotion_rule, class: Spree::PromotionRule do
3
3
  association :promotion
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :property, class: Spree::Property do
3
3
  name 'baseball_cap_color'
4
4
  presentation 'cap color'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :prototype, class: Spree::Prototype do
3
3
  name 'Baseball Cap'
4
4
  properties { [create(:property)] }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  sequence(:refund_transaction_id) { |n| "fake-refund-transaction-#{n}" }
3
3
 
4
4
  factory :refund, class: Spree::Refund do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :reimbursement, class: Spree::Reimbursement do
3
3
  transient do
4
4
  return_items_count 1
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :reimbursement_type, class: Spree::ReimbursementType do
3
3
  sequence(:name) { |n| "Reimbursement Type #{n}" }
4
4
  active true
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :return_authorization, class: Spree::ReturnAuthorization do
3
3
  association(:order, factory: :shipped_order)
4
4
  association(:stock_location, factory: :stock_location)
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :return_item, class: Spree::ReturnItem do
3
3
  association(:inventory_unit, factory: :inventory_unit, state: :shipped)
4
4
  association(:return_authorization, factory: :return_authorization)
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :role, class: Spree::Role do
3
3
  sequence(:name) { |n| "Role ##{n}" }
4
4
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :shipment, class: Spree::Shipment do
3
3
  tracking 'U10000'
4
4
  cost 100.00
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :shipping_category, class: Spree::ShippingCategory do
3
3
  sequence(:name) { |n| "ShippingCategory ##{n}" }
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :base_shipping_method, class: Spree::ShippingMethod do
3
3
  zones { |a| [Spree::Zone.global] }
4
4
  name 'UPS Ground'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :state, class: Spree::State do
3
3
  sequence(:name) { |n| "STATE_NAME_#{n}" }
4
4
  sequence(:abbr) { |n| "STATE_ABBR_#{n}" }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  # must use build()
3
3
  factory :stock_packer, class: Spree::Stock::Packer do
4
4
  transient do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :stock_item, class: Spree::StockItem do
3
3
  backorderable true
4
4
  stock_location
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :stock_location, class: Spree::StockLocation do
3
3
  name 'NY Warehouse'
4
4
  address1 '1600 Pennsylvania Ave NW'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :stock_movement, class: Spree::StockMovement do
3
3
  quantity 1
4
4
  action 'sold'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :store_credit_category, class: Spree::StoreCreditCategory do
3
3
  name "Exchange"
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :store_credit_auth_event, class: Spree::StoreCreditEvent do
3
3
  store_credit { create(:store_credit) }
4
4
  action { Spree::StoreCredit::AUTHORIZE_ACTION }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  sequence(:store_credits_order_number) { |n| "R1000#{n}" }
3
3
 
4
4
  factory :store_credit, class: Spree::StoreCredit do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :primary_credit_type, class: Spree::StoreCreditType do
3
3
  name Spree::StoreCreditType::DEFAULT_TYPE_NAME
4
4
  priority { '1' }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :store, class: Spree::Store do
3
3
  sequence(:code) { |i| "spree_#{i}" }
4
4
  name 'Spree Test Store'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :tag, class: Spree::Tag do
3
3
  sequence(:name) { |n| "Tag ##{n} - #{Kernel.rand(9999)}" }
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :tax_category, class: Spree::TaxCategory do
3
3
  name { "TaxCategory - #{rand(999999)}" }
4
4
  description { generate(:random_string) }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :tax_rate, class: Spree::TaxRate do
3
3
  zone
4
4
  amount 0.1
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :taxon, class: Spree::Taxon do
3
3
  name 'Ruby on Rails'
4
4
  taxonomy
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :taxonomy, class: Spree::Taxonomy do
3
3
  name 'Brand'
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :tracker, class: Spree::Tracker do
3
3
  analytics_id 'A100'
4
4
  active true
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  sequence :user_authentication_token do |n|
3
3
  "xxxx#{Time.current.to_i}#{rand(1000)}#{n}xxxxxxxxxxxxx"
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  sequence(:random_float) { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
3
3
 
4
4
  factory :base_variant, class: Spree::Variant do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :global_zone, class: Spree::Zone do
3
3
  name 'GlobalZone'
4
4
  description { generate(:random_string) }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :zone_member, class: Spree::ZoneMember do
3
3
  zone { |member| member.association(:zone) }
4
4
  zoneable { |member| member.association(:zoneable) }
@@ -2,23 +2,23 @@ class OrderWalkthrough
2
2
  def self.up_to(state)
3
3
  # A default store must exist to provide store settings
4
4
  unless Spree::Store.exists?
5
- FactoryGirl.create(:store)
5
+ FactoryBot.create(:store)
6
6
  end
7
7
 
8
8
  # A payment method must exist for an order to proceed through the Address state
9
9
  unless Spree::PaymentMethod.exists?
10
- FactoryGirl.create(:check_payment_method)
10
+ FactoryBot.create(:check_payment_method)
11
11
  end
12
12
 
13
13
  # Need to create a valid zone too...
14
- zone = FactoryGirl.create(:zone)
15
- country = FactoryGirl.create(:country)
14
+ zone = FactoryBot.create(:zone)
15
+ country = FactoryBot.create(:country)
16
16
  zone.members << Spree::ZoneMember.create(zoneable: country)
17
- country.states << FactoryGirl.create(:state, country: country)
17
+ country.states << FactoryBot.create(:state, country: country)
18
18
 
19
19
  # A shipping method must exist for rates to be displayed on checkout page
20
20
  unless Spree::ShippingMethod.exists?
21
- FactoryGirl.create(:shipping_method).tap do |sm|
21
+ FactoryBot.create(:shipping_method).tap do |sm|
22
22
  sm.calculator.preferred_amount = 10
23
23
  sm.calculator.preferred_currency = Spree::Config[:currency]
24
24
  sm.calculator.save
@@ -40,13 +40,13 @@ class OrderWalkthrough
40
40
  private
41
41
 
42
42
  def self.add_line_item!(order)
43
- FactoryGirl.create(:line_item, order: order)
43
+ FactoryBot.create(:line_item, order: order)
44
44
  order.reload
45
45
  end
46
46
 
47
47
  def self.address(order)
48
- order.bill_address = FactoryGirl.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
49
- order.ship_address = FactoryGirl.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
48
+ order.bill_address = FactoryBot.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
49
+ order.ship_address = FactoryBot.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
50
50
  order.next!
51
51
  end
52
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.7
4
+ version: 3.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -979,7 +979,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
979
979
  version: 1.8.23
980
980
  requirements: []
981
981
  rubyforge_project:
982
- rubygems_version: 2.6.10
982
+ rubygems_version: 2.6.13
983
983
  signing_key:
984
984
  specification_version: 4
985
985
  summary: The bare bones necessary for Spree.