spree_core 3.4.1 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/spree/order.rb +2 -2
  3. data/app/models/spree/order_contents.rb +0 -1
  4. data/app/models/spree/order_inventory.rb +4 -3
  5. data/app/models/spree/shipment.rb +9 -4
  6. data/config/initializers/premailer_rails.rb +3 -0
  7. data/lib/spree/core/version.rb +1 -1
  8. data/lib/spree/testing_support/factories.rb +3 -3
  9. data/lib/spree/testing_support/factories/address_factory.rb +1 -1
  10. data/lib/spree/testing_support/factories/adjustment_factory.rb +1 -1
  11. data/lib/spree/testing_support/factories/calculator_factory.rb +1 -1
  12. data/lib/spree/testing_support/factories/country_factory.rb +1 -1
  13. data/lib/spree/testing_support/factories/credit_card_factory.rb +1 -1
  14. data/lib/spree/testing_support/factories/customer_return_factory.rb +1 -1
  15. data/lib/spree/testing_support/factories/image_factory.rb +1 -1
  16. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +1 -1
  17. data/lib/spree/testing_support/factories/line_item_factory.rb +1 -1
  18. data/lib/spree/testing_support/factories/options_factory.rb +1 -1
  19. data/lib/spree/testing_support/factories/order_factory.rb +1 -1
  20. data/lib/spree/testing_support/factories/payment_factory.rb +1 -1
  21. data/lib/spree/testing_support/factories/payment_method_factory.rb +1 -1
  22. data/lib/spree/testing_support/factories/price_factory.rb +1 -1
  23. data/lib/spree/testing_support/factories/product_factory.rb +1 -1
  24. data/lib/spree/testing_support/factories/product_option_type_factory.rb +1 -1
  25. data/lib/spree/testing_support/factories/product_property_factory.rb +1 -1
  26. data/lib/spree/testing_support/factories/promotion_category_factory.rb +1 -1
  27. data/lib/spree/testing_support/factories/promotion_factory.rb +1 -1
  28. data/lib/spree/testing_support/factories/promotion_rule_factory.rb +1 -1
  29. data/lib/spree/testing_support/factories/property_factory.rb +1 -1
  30. data/lib/spree/testing_support/factories/prototype_factory.rb +1 -1
  31. data/lib/spree/testing_support/factories/refund_factory.rb +1 -1
  32. data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
  33. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +1 -1
  34. data/lib/spree/testing_support/factories/return_authorization_factory.rb +1 -1
  35. data/lib/spree/testing_support/factories/return_item_factory.rb +1 -1
  36. data/lib/spree/testing_support/factories/role_factory.rb +1 -1
  37. data/lib/spree/testing_support/factories/shipment_factory.rb +1 -1
  38. data/lib/spree/testing_support/factories/shipping_category_factory.rb +1 -1
  39. data/lib/spree/testing_support/factories/shipping_method_factory.rb +1 -1
  40. data/lib/spree/testing_support/factories/state_factory.rb +1 -1
  41. data/lib/spree/testing_support/factories/stock_factory.rb +1 -1
  42. data/lib/spree/testing_support/factories/stock_item_factory.rb +1 -1
  43. data/lib/spree/testing_support/factories/stock_location_factory.rb +1 -1
  44. data/lib/spree/testing_support/factories/stock_movement_factory.rb +1 -1
  45. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +1 -1
  46. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +1 -1
  47. data/lib/spree/testing_support/factories/store_credit_factory.rb +1 -1
  48. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +1 -1
  49. data/lib/spree/testing_support/factories/store_factory.rb +1 -1
  50. data/lib/spree/testing_support/factories/tag_factory.rb +1 -1
  51. data/lib/spree/testing_support/factories/tax_category_factory.rb +1 -1
  52. data/lib/spree/testing_support/factories/tax_rate_factory.rb +1 -1
  53. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  54. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  55. data/lib/spree/testing_support/factories/tracker_factory.rb +1 -1
  56. data/lib/spree/testing_support/factories/user_factory.rb +1 -1
  57. data/lib/spree/testing_support/factories/variant_factory.rb +1 -1
  58. data/lib/spree/testing_support/factories/zone_factory.rb +1 -1
  59. data/lib/spree/testing_support/factories/zone_member_factory.rb +1 -1
  60. data/lib/spree/testing_support/order_walkthrough.rb +9 -9
  61. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 508053337b635915fb696f49b04db0c3bb130e4a
4
- data.tar.gz: 97680b4cc76d9116e880d344b2218782db4ce073
3
+ metadata.gz: 68cb55c21ddd24f8248dca5549bc6cdb7ce2460c
4
+ data.tar.gz: b4ca12837622c5f82832b9e7e074e5b77a2fb294
5
5
  SHA512:
6
- metadata.gz: 4cb99684ec20ce0b8cd4377156f6345745f8ded3a50d1561f7bd693358a42c948e34bb6e095fae5a1aeec2e3a3b10e0d86f4652e2f0184eda2d3510ae832ece4
7
- data.tar.gz: 182782b5b2a6688cc2977dd6b0598c37a26fb88cf0103166e24d1299d9b98cbf551d327937c5065b6687e4c60302f93268918199c4262ade711facb0994a6e26
6
+ metadata.gz: 0eae5883047bcd05bae1feeb7f6cd1bea296466e28a2b12311f4dddb5c1d7c380e9a60844dfa91e017979bce09f4e85c1d689de4f104a4161b4d1c83acbc2a2f
7
+ data.tar.gz: a32117843440c4a5c6233bc52feac36293bdaf34ae3568c06df67901c2f4fa3b973d56346bb7a620ef4bef93a850fa517cbea09ff1a95fbf74eded59003a2007
@@ -268,8 +268,8 @@ module Spree
268
268
  self.user = user
269
269
  self.email = user.email if override_email
270
270
  self.created_by ||= user
271
- self.bill_address ||= user.bill_address
272
- self.ship_address ||= user.ship_address
271
+ self.bill_address ||= user.bill_address.try(:clone)
272
+ self.ship_address ||= user.ship_address.try(:clone)
273
273
 
274
274
  changes = slice(:user_id, :email, :created_by_id, :bill_address_id, :ship_address_id)
275
275
 
@@ -81,7 +81,6 @@ module Spree
81
81
  end
82
82
 
83
83
  def persist_totals
84
- order_updater.update_item_count
85
84
  order_updater.update
86
85
  end
87
86
 
@@ -72,10 +72,10 @@ module Spree
72
72
  if variant.should_track_inventory?
73
73
  on_hand, back_order = shipment.stock_location.fill_status(variant, quantity)
74
74
 
75
- on_hand.times { shipment.set_up_inventory('on_hand', variant, order, line_item) }
76
- back_order.times { shipment.set_up_inventory('backordered', variant, order, line_item) }
75
+ shipment.set_up_inventory('on_hand', variant, order, line_item, on_hand)
76
+ shipment.set_up_inventory('backordered', variant, order, line_item, back_order)
77
77
  else
78
- quantity.times { shipment.set_up_inventory('on_hand', variant, order, line_item) }
78
+ shipment.set_up_inventory('on_hand', variant, order, line_item, quantity)
79
79
  end
80
80
 
81
81
  # adding to this shipment, and removing from stock_location
@@ -103,6 +103,7 @@ module Spree
103
103
  end
104
104
  removed_quantity += 1
105
105
  end
106
+ inventory_unit.save! if inventory_unit.persisted?
106
107
  end
107
108
 
108
109
  shipment.destroy if shipment.inventory_units.sum(:quantity).zero?
@@ -219,6 +219,7 @@ module Spree
219
219
  selected_rate = shipping_rates.detect do |rate|
220
220
  rate.shipping_method_id == original_shipping_method_id
221
221
  end
222
+ save!
222
223
  self.selected_shipping_rate_id = selected_rate.id if selected_rate
223
224
  end
224
225
 
@@ -235,12 +236,14 @@ module Spree
235
236
  save!
236
237
  end
237
238
 
238
- def set_up_inventory(state, variant, order, line_item)
239
+ def set_up_inventory(state, variant, order, line_item, quantity = 1)
240
+ return if quantity <= 0
239
241
  inventory_units.create(
240
242
  state: state,
241
243
  variant_id: variant.id,
242
244
  order_id: order.id,
243
- line_item_id: line_item.id
245
+ line_item_id: line_item.id,
246
+ quantity: quantity
244
247
  )
245
248
  end
246
249
 
@@ -337,6 +340,7 @@ module Spree
337
340
 
338
341
  order.contents.remove(variant, quantity, shipment: self)
339
342
  order.contents.add(variant, quantity, shipment: new_shipment)
343
+ order.update_with_updater!
340
344
 
341
345
  refresh_rates
342
346
  save!
@@ -353,8 +357,9 @@ module Spree
353
357
  raise ArgumentError if quantity <= 0 || self == shipment_to_transfer_to
354
358
 
355
359
  transaction do
356
- order.contents.remove(variant, quantity, shipment: self)
357
- order.contents.add(variant, quantity, shipment: shipment_to_transfer_to)
360
+ order.contents.remove(variant, final_quantity, shipment: self)
361
+ order.contents.add(variant, final_quantity, shipment: shipment_to_transfer_to)
362
+ order.update_with_updater!
358
363
 
359
364
  refresh_rates
360
365
  save!
@@ -0,0 +1,3 @@
1
+ if Gem.loaded_specs['premailer-rails'].version >= Gem::Version.create('1.10.0')
2
+ Premailer::Rails.config[:strategies] = [:filesystem, :network, :asset_pipeline]
3
+ end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '3.4.1'
3
+ '3.4.2'
4
4
  end
5
5
  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
  factory :customer_return, class: Spree::CustomerReturn do
3
3
  association(:stock_location, factory: :stock_location)
4
4
 
@@ -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(999_999)}" }
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
  sequence(:name) { |n| "taxon_#{n}" }
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
  sequence(:name) { |n| "taxonomy_#{n}" }
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) }
@@ -1,22 +1,22 @@
1
1
  class OrderWalkthrough
2
2
  def self.up_to(state)
3
3
  # A default store must exist to provide store settings
4
- FactoryGirl.create(:store) unless Spree::Store.exists?
4
+ FactoryBot.create(:store) unless Spree::Store.exists?
5
5
 
6
6
  # A payment method must exist for an order to proceed through the Address state
7
7
  unless Spree::PaymentMethod.exists?
8
- FactoryGirl.create(:check_payment_method)
8
+ FactoryBot.create(:check_payment_method)
9
9
  end
10
10
 
11
11
  # Need to create a valid zone too...
12
- zone = FactoryGirl.create(:zone)
13
- country = FactoryGirl.create(:country)
12
+ zone = FactoryBot.create(:zone)
13
+ country = FactoryBot.create(:country)
14
14
  zone.members << Spree::ZoneMember.create(zoneable: country)
15
- country.states << FactoryGirl.create(:state, country: country)
15
+ country.states << FactoryBot.create(:state, country: country)
16
16
 
17
17
  # A shipping method must exist for rates to be displayed on checkout page
18
18
  unless Spree::ShippingMethod.exists?
19
- FactoryGirl.create(:shipping_method).tap do |sm|
19
+ FactoryBot.create(:shipping_method).tap do |sm|
20
20
  sm.calculator.preferred_amount = 10
21
21
  sm.calculator.preferred_currency = Spree::Config[:currency]
22
22
  sm.calculator.save
@@ -38,13 +38,13 @@ class OrderWalkthrough
38
38
  private
39
39
 
40
40
  def self.add_line_item!(order)
41
- FactoryGirl.create(:line_item, order: order)
41
+ FactoryBot.create(:line_item, order: order)
42
42
  order.reload
43
43
  end
44
44
 
45
45
  def self.address(order)
46
- order.bill_address = FactoryGirl.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
47
- order.ship_address = FactoryGirl.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
46
+ order.bill_address = FactoryBot.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
47
+ order.ship_address = FactoryBot.create(:address, country_id: Spree::Zone.global.members.first.zoneable.id)
48
48
  order.next!
49
49
  end
50
50
 
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.4.1
4
+ version: 3.4.2
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-10-20 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -568,6 +568,7 @@ files:
568
568
  - config/initializers/assets.rb
569
569
  - config/initializers/friendly_id.rb
570
570
  - config/initializers/premailer_assets.rb
571
+ - config/initializers/premailer_rails.rb
571
572
  - config/locales/en.yml
572
573
  - config/routes.rb
573
574
  - db/default/spree/countries.rb