solidus_core 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of solidus_core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/factories/address_factory.rb +12 -12
- data/lib/spree/testing_support/factories/adjustment_factory.rb +5 -5
- data/lib/spree/testing_support/factories/calculator_factory.rb +5 -5
- data/lib/spree/testing_support/factories/country_factory.rb +1 -1
- data/lib/spree/testing_support/factories/credit_card_factory.rb +5 -5
- data/lib/spree/testing_support/factories/customer_return_factory.rb +1 -1
- data/lib/spree/testing_support/factories/inventory_unit_factory.rb +2 -2
- data/lib/spree/testing_support/factories/line_item_factory.rb +2 -2
- data/lib/spree/testing_support/factories/option_type_factory.rb +1 -1
- data/lib/spree/testing_support/factories/option_value_factory.rb +1 -1
- data/lib/spree/testing_support/factories/order_factory.rb +13 -13
- data/lib/spree/testing_support/factories/payment_factory.rb +6 -6
- data/lib/spree/testing_support/factories/payment_method_factory.rb +15 -15
- data/lib/spree/testing_support/factories/price_factory.rb +2 -2
- data/lib/spree/testing_support/factories/product_factory.rb +6 -6
- data/lib/spree/testing_support/factories/promotion_category_factory.rb +1 -1
- data/lib/spree/testing_support/factories/promotion_factory.rb +5 -5
- data/lib/spree/testing_support/factories/property_factory.rb +2 -2
- data/lib/spree/testing_support/factories/refund_factory.rb +2 -2
- data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
- data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +2 -2
- data/lib/spree/testing_support/factories/return_authorization_factory.rb +1 -1
- data/lib/spree/testing_support/factories/role_factory.rb +1 -1
- data/lib/spree/testing_support/factories/shipment_factory.rb +4 -4
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +6 -6
- data/lib/spree/testing_support/factories/state_factory.rb +2 -2
- data/lib/spree/testing_support/factories/stock_item_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_location_factory.rb +8 -8
- data/lib/spree/testing_support/factories/stock_movement_factory.rb +3 -3
- data/lib/spree/testing_support/factories/store_credit_category_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_factory.rb +2 -2
- data/lib/spree/testing_support/factories/store_credit_update_reason_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_factory.rb +1 -1
- data/lib/spree/testing_support/factories/tax_rate_factory.rb +1 -1
- data/lib/spree/testing_support/factories/taxon_factory.rb +2 -2
- data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
- data/lib/spree/testing_support/factories/user_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_factory.rb +7 -7
- data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +1 -1
- data/lib/spree/testing_support/factories/zone_factory.rb +1 -1
- data/spec/models/spree/order_spec.rb +5 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b1faa3d07e3e11498eb9f5d91ef10b3c6ca759daa240cd5528412d1cfcc00dd
|
4
|
+
data.tar.gz: e39531d3b4b5f7ff745d7959c03ef3004ea8e8d2b2a93220385f2a80f3c2e913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cd2570fc767e2ba36218fc24ade8c3aa4c2187902f4d59fc2a1b6be74b6a94398754096a92718743a1d0db3a604f82889e48cdfbc12326b6d764ef5e5caafb1
|
7
|
+
data.tar.gz: 5246da08e9bb19b7fa296b4112ba9db91de63a998fc534b1d000891eef81bd9eb46938563780ccb72a7db4fca7961e4de71e2fcdc7189ecbc2114e1d6e774379
|
data/lib/spree/core/version.rb
CHANGED
@@ -5,19 +5,19 @@ FactoryBot.define do
|
|
5
5
|
factory :address, class: 'Spree::Address' do
|
6
6
|
transient do
|
7
7
|
# There's `Spree::Address#country_iso=`, prohibiting me from using `country_iso` here
|
8
|
-
country_iso_code 'US'
|
9
|
-
state_code 'AL'
|
8
|
+
country_iso_code { 'US' }
|
9
|
+
state_code { 'AL' }
|
10
10
|
end
|
11
11
|
|
12
|
-
firstname 'John'
|
13
|
-
lastname nil
|
14
|
-
company 'Company'
|
15
|
-
address1 '10 Lovely Street'
|
16
|
-
address2 'Northwest'
|
17
|
-
city 'Herndon'
|
12
|
+
firstname { 'John' }
|
13
|
+
lastname { nil }
|
14
|
+
company { 'Company' }
|
15
|
+
address1 { '10 Lovely Street' }
|
16
|
+
address2 { 'Northwest' }
|
17
|
+
city { 'Herndon' }
|
18
18
|
sequence(:zipcode, 10001) { |i| i.to_s }
|
19
|
-
phone '555-555-0199'
|
20
|
-
alternative_phone '555-555-0199'
|
19
|
+
phone { '555-555-0199' }
|
20
|
+
alternative_phone { '555-555-0199' }
|
21
21
|
|
22
22
|
state do |address|
|
23
23
|
Spree::State.joins(:country).where('spree_countries.iso = (?)', country_iso_code).find_by(abbr: state_code) ||
|
@@ -34,10 +34,10 @@ FactoryBot.define do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
factory :ship_address, parent: :address do
|
37
|
-
address1 'A Different Road'
|
37
|
+
address1 { 'A Different Road' }
|
38
38
|
end
|
39
39
|
|
40
40
|
factory :bill_address, parent: :address do
|
41
|
-
address1 'PO Box 1337'
|
41
|
+
address1 { 'PO Box 1337' }
|
42
42
|
end
|
43
43
|
end
|
@@ -8,10 +8,10 @@ FactoryBot.define do
|
|
8
8
|
factory :adjustment, class: 'Spree::Adjustment' do
|
9
9
|
order
|
10
10
|
adjustable { order }
|
11
|
-
amount 100.0
|
12
|
-
label 'Shipping'
|
11
|
+
amount { 100.0 }
|
12
|
+
label { 'Shipping' }
|
13
13
|
association(:source, factory: :tax_rate)
|
14
|
-
eligible true
|
14
|
+
eligible { true }
|
15
15
|
|
16
16
|
after(:build) do |adjustment|
|
17
17
|
adjustments = adjustment.adjustable.adjustments
|
@@ -23,8 +23,8 @@ FactoryBot.define do
|
|
23
23
|
factory :tax_adjustment, class: 'Spree::Adjustment' do
|
24
24
|
order { adjustable.order }
|
25
25
|
association(:adjustable, factory: :line_item)
|
26
|
-
amount 10.0
|
27
|
-
label 'VAT 5%'
|
26
|
+
amount { 10.0 }
|
27
|
+
label { 'VAT 5%' }
|
28
28
|
|
29
29
|
after(:create) do |adjustment|
|
30
30
|
# Set correct tax category, so that adjustment amount is not 0
|
@@ -1,24 +1,24 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :calculator, aliases: [:flat_rate_calculator], class: 'Spree::Calculator::FlatRate' do
|
3
|
-
preferred_amount 10.0
|
3
|
+
preferred_amount { 10.0 }
|
4
4
|
end
|
5
5
|
|
6
6
|
factory :no_amount_calculator, class: 'Spree::Calculator::FlatRate' do
|
7
|
-
preferred_amount 0
|
7
|
+
preferred_amount { 0 }
|
8
8
|
end
|
9
9
|
|
10
10
|
factory :default_tax_calculator, class: 'Spree::Calculator::DefaultTax' do
|
11
11
|
end
|
12
12
|
|
13
13
|
factory :shipping_calculator, class: 'Spree::Calculator::Shipping::FlatRate' do
|
14
|
-
preferred_amount 10.0
|
14
|
+
preferred_amount { 10.0 }
|
15
15
|
end
|
16
16
|
|
17
17
|
factory :shipping_no_amount_calculator, class: 'Spree::Calculator::Shipping::FlatRate' do
|
18
|
-
preferred_amount 0
|
18
|
+
preferred_amount { 0 }
|
19
19
|
end
|
20
20
|
|
21
21
|
factory :percent_on_item_calculator, class: 'Spree::Calculator::PercentOnLineItem' do
|
22
|
-
preferred_percent 10
|
22
|
+
preferred_percent { 10 }
|
23
23
|
end
|
24
24
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :credit_card, class: 'Spree::CreditCard' do
|
3
|
-
verification_value 123
|
4
|
-
month 12
|
3
|
+
verification_value { 123 }
|
4
|
+
month { 12 }
|
5
5
|
year { 1.year.from_now.year }
|
6
|
-
number '4111111111111111'
|
7
|
-
name 'Spree Commerce'
|
6
|
+
number { '4111111111111111' }
|
7
|
+
name { 'Spree Commerce' }
|
8
8
|
association(:payment_method, factory: :credit_card_payment_method)
|
9
9
|
association(:address)
|
10
10
|
|
11
11
|
trait :failing do
|
12
|
-
number "0000000000000000"
|
12
|
+
number { "0000000000000000" }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -7,7 +7,7 @@ FactoryBot.define do
|
|
7
7
|
association(:stock_location, factory: :stock_location)
|
8
8
|
|
9
9
|
transient do
|
10
|
-
line_items_count 1
|
10
|
+
line_items_count { 1 }
|
11
11
|
return_items_count { line_items_count }
|
12
12
|
shipped_order { create :shipped_order, line_items_count: line_items_count }
|
13
13
|
return_authorization { create :return_authorization, order: shipped_order }
|
@@ -6,7 +6,7 @@ require 'spree/testing_support/factories/shipment_factory'
|
|
6
6
|
FactoryBot.define do
|
7
7
|
factory :inventory_unit, class: 'Spree::InventoryUnit' do
|
8
8
|
transient do
|
9
|
-
order nil
|
9
|
+
order { nil }
|
10
10
|
end
|
11
11
|
|
12
12
|
variant
|
@@ -17,7 +17,7 @@ FactoryBot.define do
|
|
17
17
|
build(:line_item, variant: variant)
|
18
18
|
end
|
19
19
|
end
|
20
|
-
state 'on_hand'
|
20
|
+
state { 'on_hand' }
|
21
21
|
shipment { build(:shipment, state: 'pending', order: line_item.order) }
|
22
22
|
# return_authorization
|
23
23
|
end
|
@@ -3,11 +3,11 @@ require 'spree/testing_support/factories/product_factory'
|
|
3
3
|
|
4
4
|
FactoryBot.define do
|
5
5
|
factory :line_item, class: 'Spree::LineItem' do
|
6
|
-
quantity 1
|
6
|
+
quantity { 1 }
|
7
7
|
price { BigDecimal('10.00') }
|
8
8
|
order
|
9
9
|
transient do
|
10
|
-
product nil
|
10
|
+
product { nil }
|
11
11
|
end
|
12
12
|
variant do
|
13
13
|
(product || create(:product)).master
|
@@ -10,7 +10,7 @@ FactoryBot.define do
|
|
10
10
|
user
|
11
11
|
bill_address
|
12
12
|
ship_address
|
13
|
-
completed_at nil
|
13
|
+
completed_at { nil }
|
14
14
|
email { user.try(:email) }
|
15
15
|
store
|
16
16
|
|
@@ -38,10 +38,10 @@ FactoryBot.define do
|
|
38
38
|
ship_address
|
39
39
|
|
40
40
|
transient do
|
41
|
-
line_items_count 1
|
41
|
+
line_items_count { 1 }
|
42
42
|
line_items_attributes { [{}] * line_items_count }
|
43
|
-
shipment_cost 100
|
44
|
-
shipping_method nil
|
43
|
+
shipment_cost { 100 }
|
44
|
+
shipping_method { nil }
|
45
45
|
stock_location { create(:stock_location) }
|
46
46
|
end
|
47
47
|
|
@@ -62,7 +62,7 @@ FactoryBot.define do
|
|
62
62
|
|
63
63
|
factory :completed_order_with_promotion do
|
64
64
|
transient do
|
65
|
-
promotion nil
|
65
|
+
promotion { nil }
|
66
66
|
end
|
67
67
|
|
68
68
|
after(:create) do |order, evaluator|
|
@@ -79,11 +79,11 @@ FactoryBot.define do
|
|
79
79
|
end
|
80
80
|
|
81
81
|
factory :order_ready_to_complete do
|
82
|
-
state 'confirm'
|
83
|
-
payment_state 'checkout'
|
82
|
+
state { 'confirm' }
|
83
|
+
payment_state { 'checkout' }
|
84
84
|
|
85
85
|
transient do
|
86
|
-
payment_type :credit_card_payment
|
86
|
+
payment_type { :credit_card_payment }
|
87
87
|
end
|
88
88
|
|
89
89
|
after(:create) do |order, evaluator|
|
@@ -98,7 +98,7 @@ FactoryBot.define do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
factory :completed_order_with_totals do
|
101
|
-
state 'complete'
|
101
|
+
state { 'complete' }
|
102
102
|
|
103
103
|
after(:create) do |order|
|
104
104
|
order.shipments.each do |shipment|
|
@@ -114,11 +114,11 @@ FactoryBot.define do
|
|
114
114
|
end
|
115
115
|
|
116
116
|
factory :order_ready_to_ship do
|
117
|
-
payment_state 'paid'
|
118
|
-
shipment_state 'ready'
|
117
|
+
payment_state { 'paid' }
|
118
|
+
shipment_state { 'ready' }
|
119
119
|
|
120
120
|
transient do
|
121
|
-
payment_type :credit_card_payment
|
121
|
+
payment_type { :credit_card_payment }
|
122
122
|
end
|
123
123
|
|
124
124
|
after(:create) do |order, evaluator|
|
@@ -131,7 +131,7 @@ FactoryBot.define do
|
|
131
131
|
|
132
132
|
factory :shipped_order do
|
133
133
|
transient do
|
134
|
-
with_cartons true
|
134
|
+
with_cartons { true }
|
135
135
|
end
|
136
136
|
after(:create) do |order, evaluator|
|
137
137
|
order.shipments.each do |shipment|
|
@@ -8,26 +8,26 @@ FactoryBot.define do
|
|
8
8
|
association(:payment_method, factory: :credit_card_payment_method)
|
9
9
|
source { create(:credit_card, user: order.user, address: order.bill_address) }
|
10
10
|
order
|
11
|
-
state 'checkout'
|
12
|
-
response_code '12345'
|
11
|
+
state { 'checkout' }
|
12
|
+
response_code { '12345' }
|
13
13
|
|
14
14
|
trait :completed do
|
15
|
-
state 'completed'
|
15
|
+
state { 'completed' }
|
16
16
|
end
|
17
17
|
|
18
18
|
trait :failing do
|
19
|
-
response_code '00000'
|
19
|
+
response_code { '00000' }
|
20
20
|
association(:source, :failing, { factory: :credit_card })
|
21
21
|
end
|
22
22
|
|
23
23
|
factory :payment_with_refund do
|
24
24
|
transient do
|
25
|
-
refund_amount 5
|
25
|
+
refund_amount { 5 }
|
26
26
|
end
|
27
27
|
|
28
28
|
amount { refund_amount }
|
29
29
|
|
30
|
-
state 'completed'
|
30
|
+
state { 'completed' }
|
31
31
|
|
32
32
|
refunds { build_list :refund, 1, amount: refund_amount }
|
33
33
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :payment_method, aliases: [:credit_card_payment_method], class: 'Spree::PaymentMethod::BogusCreditCard' do
|
3
|
-
name 'Credit Card'
|
4
|
-
available_to_admin true
|
5
|
-
available_to_users true
|
3
|
+
name { 'Credit Card' }
|
4
|
+
available_to_admin { true }
|
5
|
+
available_to_users { true }
|
6
6
|
end
|
7
7
|
|
8
8
|
factory :check_payment_method, class: 'Spree::PaymentMethod::Check' do
|
9
|
-
name 'Check'
|
10
|
-
available_to_admin true
|
11
|
-
available_to_users true
|
9
|
+
name { 'Check' }
|
10
|
+
available_to_admin { true }
|
11
|
+
available_to_users { true }
|
12
12
|
end
|
13
13
|
|
14
14
|
# authorize.net was moved to spree_gateway.
|
15
15
|
# Leaving this factory in place with bogus in case anyone is using it.
|
16
16
|
factory :simple_credit_card_payment_method, class: 'Spree::PaymentMethod::SimpleBogusCreditCard' do
|
17
|
-
name 'Credit Card'
|
18
|
-
available_to_admin true
|
19
|
-
available_to_users true
|
17
|
+
name { 'Credit Card' }
|
18
|
+
available_to_admin { true }
|
19
|
+
available_to_users { true }
|
20
20
|
end
|
21
21
|
|
22
22
|
factory :store_credit_payment_method, class: 'Spree::PaymentMethod::StoreCredit' do
|
23
|
-
name "Store Credit"
|
24
|
-
description "Store Credit"
|
25
|
-
active true
|
26
|
-
available_to_admin false
|
27
|
-
available_to_users false
|
28
|
-
auto_capture true
|
23
|
+
name { "Store Credit" }
|
24
|
+
description { "Store Credit" }
|
25
|
+
active { true }
|
26
|
+
available_to_admin { false }
|
27
|
+
available_to_users { false }
|
28
|
+
auto_capture { true }
|
29
29
|
end
|
30
30
|
end
|
@@ -7,20 +7,20 @@ require 'spree/testing_support/factories/product_option_type_factory'
|
|
7
7
|
FactoryBot.define do
|
8
8
|
factory :base_product, class: 'Spree::Product' do
|
9
9
|
sequence(:name) { |n| "Product ##{n} - #{Kernel.rand(9999)}" }
|
10
|
-
description "As seen on TV!"
|
11
|
-
price 19.99
|
12
|
-
cost_price 17.00
|
10
|
+
description { "As seen on TV!" }
|
11
|
+
price { 19.99 }
|
12
|
+
cost_price { 17.00 }
|
13
13
|
sku { generate(:sku) }
|
14
14
|
available_on { 1.year.ago }
|
15
|
-
deleted_at nil
|
15
|
+
deleted_at { nil }
|
16
16
|
shipping_category { |r| Spree::ShippingCategory.first || r.association(:shipping_category) }
|
17
17
|
|
18
18
|
# ensure stock item will be created for this products master
|
19
19
|
before(:create) { create(:stock_location) if Spree::StockLocation.count == 0 }
|
20
20
|
|
21
21
|
factory :custom_product do
|
22
|
-
name 'Custom Product'
|
23
|
-
price 17.99
|
22
|
+
name { 'Custom Product' }
|
23
|
+
price { 17.99 }
|
24
24
|
|
25
25
|
tax_category { |r| Spree::TaxCategory.first || r.association(:tax_category) }
|
26
26
|
end
|
@@ -3,10 +3,10 @@ require 'spree/testing_support/factories/variant_factory'
|
|
3
3
|
|
4
4
|
FactoryBot.define do
|
5
5
|
factory :promotion, class: 'Spree::Promotion' do
|
6
|
-
name 'Promo'
|
6
|
+
name { 'Promo' }
|
7
7
|
|
8
8
|
transient do
|
9
|
-
code nil
|
9
|
+
code { nil }
|
10
10
|
end
|
11
11
|
before(:create) do |promotion, evaluator|
|
12
12
|
if evaluator.code
|
@@ -16,7 +16,7 @@ FactoryBot.define do
|
|
16
16
|
|
17
17
|
trait :with_line_item_adjustment do
|
18
18
|
transient do
|
19
|
-
adjustment_rate 10
|
19
|
+
adjustment_rate { 10 }
|
20
20
|
end
|
21
21
|
|
22
22
|
after(:create) do |promotion, evaluator|
|
@@ -29,7 +29,7 @@ FactoryBot.define do
|
|
29
29
|
|
30
30
|
trait :with_order_adjustment do
|
31
31
|
transient do
|
32
|
-
weighted_order_adjustment_amount 10
|
32
|
+
weighted_order_adjustment_amount { 10 }
|
33
33
|
end
|
34
34
|
|
35
35
|
after(:create) do |promotion, evaluator|
|
@@ -44,7 +44,7 @@ FactoryBot.define do
|
|
44
44
|
|
45
45
|
trait :with_item_total_rule do
|
46
46
|
transient do
|
47
|
-
item_total_threshold_amount 10
|
47
|
+
item_total_threshold_amount { 10 }
|
48
48
|
end
|
49
49
|
|
50
50
|
after(:create) do |promotion, evaluator|
|
@@ -6,10 +6,10 @@ FactoryBot.define do
|
|
6
6
|
|
7
7
|
factory :refund, class: 'Spree::Refund' do
|
8
8
|
transient do
|
9
|
-
payment_amount 100
|
9
|
+
payment_amount { 100 }
|
10
10
|
end
|
11
11
|
|
12
|
-
amount 100.00
|
12
|
+
amount { 100.00 }
|
13
13
|
transaction_id { generate(:refund_transaction_id) }
|
14
14
|
payment do
|
15
15
|
association(:payment, state: 'completed', amount: payment_amount)
|
@@ -3,7 +3,7 @@ require 'spree/testing_support/factories/customer_return_factory'
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :reimbursement, class: 'Spree::Reimbursement' do
|
5
5
|
transient do
|
6
|
-
return_items_count 1
|
6
|
+
return_items_count { 1 }
|
7
7
|
end
|
8
8
|
|
9
9
|
customer_return { create(:customer_return_with_accepted_items, line_items_count: return_items_count) }
|
@@ -7,7 +7,7 @@ FactoryBot.define do
|
|
7
7
|
association(:order, factory: :shipped_order)
|
8
8
|
association(:stock_location, factory: :stock_location)
|
9
9
|
association(:reason, factory: :return_reason)
|
10
|
-
memo 'Items were broken'
|
10
|
+
memo { 'Items were broken' }
|
11
11
|
end
|
12
12
|
|
13
13
|
factory :new_return_authorization, class: 'Spree::ReturnAuthorization' do
|
@@ -4,14 +4,14 @@ require 'spree/testing_support/factories/shipping_method_factory'
|
|
4
4
|
|
5
5
|
FactoryBot.define do
|
6
6
|
factory :shipment, class: 'Spree::Shipment' do
|
7
|
-
tracking 'U10000'
|
8
|
-
cost 100.00
|
9
|
-
state 'pending'
|
7
|
+
tracking { 'U10000' }
|
8
|
+
cost { 100.00 }
|
9
|
+
state { 'pending' }
|
10
10
|
order
|
11
11
|
stock_location
|
12
12
|
|
13
13
|
transient do
|
14
|
-
shipping_method nil
|
14
|
+
shipping_method { nil }
|
15
15
|
end
|
16
16
|
|
17
17
|
after(:create) do |shipment, evaluator|
|
@@ -14,15 +14,15 @@ FactoryBot.define do
|
|
14
14
|
[Spree::Zone.find_by(name: 'GlobalZone') || FactoryBot.create(:global_zone)]
|
15
15
|
end
|
16
16
|
|
17
|
-
name 'UPS Ground'
|
18
|
-
code 'UPS_GROUND'
|
19
|
-
carrier 'UPS'
|
20
|
-
service_level '1DAYGROUND'
|
17
|
+
name { 'UPS Ground' }
|
18
|
+
code { 'UPS_GROUND' }
|
19
|
+
carrier { 'UPS' }
|
20
|
+
service_level { '1DAYGROUND' }
|
21
21
|
|
22
22
|
calculator { |s| s.association(:shipping_calculator, strategy: :build, preferred_amount: s.cost, preferred_currency: s.currency) }
|
23
23
|
|
24
24
|
transient do
|
25
|
-
cost 10.0
|
25
|
+
cost { 10.0 }
|
26
26
|
currency { Spree::Config[:currency] }
|
27
27
|
end
|
28
28
|
|
@@ -33,7 +33,7 @@ FactoryBot.define do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
factory :free_shipping_method, class: 'Spree::ShippingMethod' do
|
36
|
-
cost nil
|
36
|
+
cost { nil }
|
37
37
|
association(:calculator, factory: :shipping_no_amount_calculator, strategy: :build)
|
38
38
|
end
|
39
39
|
end
|
@@ -3,8 +3,8 @@ require 'spree/testing_support/factories/country_factory'
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :state, class: 'Spree::State' do
|
5
5
|
transient do
|
6
|
-
country_iso 'US'
|
7
|
-
state_code 'AL'
|
6
|
+
country_iso { 'US' }
|
7
|
+
state_code { 'AL' }
|
8
8
|
|
9
9
|
carmen_subregion do
|
10
10
|
carmen_country = Carmen::Country.coded(country.iso)
|
@@ -3,7 +3,7 @@ require 'spree/testing_support/factories/variant_factory'
|
|
3
3
|
|
4
4
|
FactoryBot.define do
|
5
5
|
factory :stock_item, class: 'Spree::StockItem' do
|
6
|
-
backorderable true
|
6
|
+
backorderable { true }
|
7
7
|
association :stock_location, factory: :stock_location_without_variant_propagation
|
8
8
|
variant
|
9
9
|
|
@@ -4,13 +4,13 @@ require 'spree/testing_support/factories/product_factory'
|
|
4
4
|
|
5
5
|
FactoryBot.define do
|
6
6
|
factory :stock_location, class: 'Spree::StockLocation' do
|
7
|
-
name 'NY Warehouse'
|
8
|
-
address1 '1600 Pennsylvania Ave NW'
|
9
|
-
city 'Washington'
|
10
|
-
zipcode '20500'
|
11
|
-
phone '(202) 456-1111'
|
12
|
-
active true
|
13
|
-
backorderable_default true
|
7
|
+
name { 'NY Warehouse' }
|
8
|
+
address1 { '1600 Pennsylvania Ave NW' }
|
9
|
+
city { 'Washington' }
|
10
|
+
zipcode { '20500' }
|
11
|
+
phone { '(202) 456-1111' }
|
12
|
+
active { true }
|
13
|
+
backorderable_default { true }
|
14
14
|
|
15
15
|
country { |stock_location| Spree::Country.first || stock_location.association(:country) }
|
16
16
|
state do |stock_location|
|
@@ -21,7 +21,7 @@ FactoryBot.define do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
factory :stock_location_without_variant_propagation do
|
24
|
-
propagate_all_variants false
|
24
|
+
propagate_all_variants { false }
|
25
25
|
end
|
26
26
|
|
27
27
|
factory :stock_location_with_items do
|
@@ -2,12 +2,12 @@ require 'spree/testing_support/factories/stock_item_factory'
|
|
2
2
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :stock_movement, class: 'Spree::StockMovement' do
|
5
|
-
quantity 1
|
6
|
-
action 'sold'
|
5
|
+
quantity { 1 }
|
6
|
+
action { 'sold' }
|
7
7
|
stock_item
|
8
8
|
end
|
9
9
|
|
10
10
|
trait :received do
|
11
|
-
action 'received'
|
11
|
+
action { 'received' }
|
12
12
|
end
|
13
13
|
end
|
@@ -7,8 +7,8 @@ FactoryBot.define do
|
|
7
7
|
user
|
8
8
|
association :created_by, factory: :user
|
9
9
|
association :category, factory: :store_credit_category
|
10
|
-
amount 150.00
|
11
|
-
currency "USD"
|
10
|
+
amount { 150.00 }
|
11
|
+
currency { "USD" }
|
12
12
|
association :credit_type, factory: :primary_credit_type
|
13
13
|
end
|
14
14
|
end
|
@@ -5,7 +5,7 @@ require 'spree/testing_support/factories/zone_factory'
|
|
5
5
|
FactoryBot.define do
|
6
6
|
factory :tax_rate, class: 'Spree::TaxRate' do
|
7
7
|
zone
|
8
|
-
amount 0.1
|
8
|
+
amount { 0.1 }
|
9
9
|
association(:calculator, factory: :default_tax_calculator)
|
10
10
|
tax_categories { [build(:tax_category)] }
|
11
11
|
end
|
@@ -5,7 +5,7 @@ require 'spree/testing_support/factories/address_factory'
|
|
5
5
|
FactoryBot.define do
|
6
6
|
factory :user, class: Spree::UserClassHandle.new do
|
7
7
|
email { generate(:email) }
|
8
|
-
password 'secret'
|
8
|
+
password { 'secret' }
|
9
9
|
password_confirmation { password }
|
10
10
|
|
11
11
|
trait :with_api_key do
|
@@ -7,11 +7,11 @@ FactoryBot.define do
|
|
7
7
|
sequence(:random_float) { BigDecimal("#{rand(200)}.#{rand(99)}") }
|
8
8
|
|
9
9
|
factory :base_variant, class: 'Spree::Variant' do
|
10
|
-
price 19.99
|
11
|
-
cost_price 17.00
|
10
|
+
price { 19.99 }
|
11
|
+
cost_price { 17.00 }
|
12
12
|
sku { generate(:sku) }
|
13
|
-
is_master 0
|
14
|
-
track_inventory true
|
13
|
+
is_master { 0 }
|
14
|
+
track_inventory { true }
|
15
15
|
|
16
16
|
product { |p| p.association(:base_product) }
|
17
17
|
|
@@ -25,16 +25,16 @@ FactoryBot.define do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
factory :master_variant do
|
28
|
-
is_master 1
|
28
|
+
is_master { 1 }
|
29
29
|
before(:create){ |variant| variant.product.master = variant }
|
30
30
|
product { build(:base_product) }
|
31
31
|
end
|
32
32
|
|
33
33
|
factory :on_demand_variant do
|
34
|
-
track_inventory false
|
34
|
+
track_inventory { false }
|
35
35
|
|
36
36
|
factory :on_demand_master_variant do
|
37
|
-
is_master 1
|
37
|
+
is_master { 1 }
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -3,7 +3,7 @@ require 'spree/testing_support/factories/country_factory'
|
|
3
3
|
|
4
4
|
FactoryBot.define do
|
5
5
|
factory :global_zone, class: 'Spree::Zone' do
|
6
|
-
name 'GlobalZone'
|
6
|
+
name { 'GlobalZone' }
|
7
7
|
zone_members do |proxy|
|
8
8
|
zone = proxy.instance_eval { @instance }
|
9
9
|
Spree::Country.all.map do |c|
|
@@ -377,13 +377,13 @@ RSpec.describe Spree::Order, type: :model do
|
|
377
377
|
|
378
378
|
it "does nothing if any shipments are ready" do
|
379
379
|
shipment = create(:shipment, order: subject, state: "ready")
|
380
|
-
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
|
380
|
+
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
|
381
381
|
expect { shipment.reload }.not_to raise_error
|
382
382
|
end
|
383
383
|
|
384
384
|
it "does nothing if any shipments are shipped" do
|
385
385
|
shipment = create(:shipment, order: subject, state: "shipped")
|
386
|
-
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments }
|
386
|
+
expect { subject.ensure_updated_shipments }.not_to change { subject.reload.shipments.pluck(:id) }
|
387
387
|
expect { shipment.reload }.not_to raise_error
|
388
388
|
end
|
389
389
|
end
|
@@ -1096,11 +1096,12 @@ RSpec.describe Spree::Order, type: :model do
|
|
1096
1096
|
|
1097
1097
|
it "raises an error if any shipments are ready" do
|
1098
1098
|
shipment = create(:shipment, order: subject, state: "ready")
|
1099
|
+
|
1099
1100
|
expect {
|
1100
1101
|
expect {
|
1101
1102
|
subject.create_proposed_shipments
|
1102
1103
|
}.to raise_error(Spree::Order::CannotRebuildShipments)
|
1103
|
-
}.not_to change { subject.reload.shipments }
|
1104
|
+
}.not_to change { subject.reload.shipments.pluck(:id) }
|
1104
1105
|
|
1105
1106
|
expect { shipment.reload }.not_to raise_error
|
1106
1107
|
end
|
@@ -1111,7 +1112,7 @@ RSpec.describe Spree::Order, type: :model do
|
|
1111
1112
|
expect {
|
1112
1113
|
subject.create_proposed_shipments
|
1113
1114
|
}.to raise_error(Spree::Order::CannotRebuildShipments)
|
1114
|
-
}.not_to change { subject.reload.shipments }
|
1115
|
+
}.not_to change { subject.reload.shipments.pluck(:id) }
|
1115
1116
|
|
1116
1117
|
expect { shipment.reload }.not_to raise_error
|
1117
1118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -1136,7 +1136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1136
1136
|
version: 1.8.23
|
1137
1137
|
requirements: []
|
1138
1138
|
rubyforge_project:
|
1139
|
-
rubygems_version: 2.7.
|
1139
|
+
rubygems_version: 2.7.3
|
1140
1140
|
signing_key:
|
1141
1141
|
specification_version: 4
|
1142
1142
|
summary: Essential models, mailers, and classes for the Solidus e-commerce project.
|