solidus_sample 2.2.2 → 2.3.0.beta1
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.
- checksums.yaml +4 -4
- data/db/samples/addresses.rb +2 -2
- data/db/samples/assets.rb +9 -9
- data/db/samples/option_values.rb +2 -2
- data/db/samples/orders.rb +10 -6
- data/db/samples/payment_methods.rb +1 -1
- data/db/samples/product_option_types.rb +3 -3
- data/db/samples/product_properties.rb +1 -1
- data/db/samples/products.rb +2 -2
- data/db/samples/shipping_methods.rb +4 -4
- data/db/samples/tax_rates.rb +8 -4
- data/db/samples/taxons.rb +4 -4
- data/db/samples/variants.rb +16 -16
- data/spec/spec_helper.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 738dadf7d78a796d7143f42149d3b2ce1ab1af16
|
4
|
+
data.tar.gz: 354f73b3a2fc49f4229783b637199ae82103af8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5259942c3ce4c04c19e4967f49fbd1cc940ae624b541aa5d4e48bbdf3bcdae4ef382ecbba94ba90ed76e74827c8df0d24e87aca35ad09e80d4ea2c6cd940b24c
|
7
|
+
data.tar.gz: 1dea108fcfd30e96b82a434364cfcd5968591c1bc929e177286f652240fa2fc5cd73dc0aa632f37d7169f4145a0bb5e1ff2900f70a7ed66f0e6670c538aed20f
|
data/db/samples/addresses.rb
CHANGED
data/db/samples/assets.rb
CHANGED
@@ -2,15 +2,15 @@ Spree::Sample.load_sample("products")
|
|
2
2
|
Spree::Sample.load_sample("variants")
|
3
3
|
|
4
4
|
products = {}
|
5
|
-
products[:ror_baseball_jersey] = Spree::Product.
|
6
|
-
products[:ror_tote] = Spree::Product.
|
7
|
-
products[:ror_bag] = Spree::Product.
|
8
|
-
products[:ror_jr_spaghetti] = Spree::Product.
|
9
|
-
products[:ror_mug] = Spree::Product.
|
10
|
-
products[:ror_ringer] = Spree::Product.
|
11
|
-
products[:ror_stein] = Spree::Product.
|
12
|
-
products[:ruby_baseball_jersey] = Spree::Product.
|
13
|
-
products[:apache_baseball_jersey] = Spree::Product.
|
5
|
+
products[:ror_baseball_jersey] = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
|
6
|
+
products[:ror_tote] = Spree::Product.find_by!(name: "Ruby on Rails Tote")
|
7
|
+
products[:ror_bag] = Spree::Product.find_by!(name: "Ruby on Rails Bag")
|
8
|
+
products[:ror_jr_spaghetti] = Spree::Product.find_by!(name: "Ruby on Rails Jr. Spaghetti")
|
9
|
+
products[:ror_mug] = Spree::Product.find_by!(name: "Ruby on Rails Mug")
|
10
|
+
products[:ror_ringer] = Spree::Product.find_by!(name: "Ruby on Rails Ringer T-Shirt")
|
11
|
+
products[:ror_stein] = Spree::Product.find_by!(name: "Ruby on Rails Stein")
|
12
|
+
products[:ruby_baseball_jersey] = Spree::Product.find_by!(name: "Ruby Baseball Jersey")
|
13
|
+
products[:apache_baseball_jersey] = Spree::Product.find_by!(name: "Apache Baseball Jersey")
|
14
14
|
|
15
15
|
def image(name, type = "jpeg")
|
16
16
|
images_path = Pathname.new(File.dirname(__FILE__)) + "images"
|
data/db/samples/option_values.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Spree::Sample.load_sample("option_types")
|
2
2
|
|
3
|
-
size = Spree::OptionType.
|
4
|
-
color = Spree::OptionType.
|
3
|
+
size = Spree::OptionType.find_by!(presentation: "Size")
|
4
|
+
color = Spree::OptionType.find_by!(presentation: "Color")
|
5
5
|
|
6
6
|
Spree::OptionValue.create!([
|
7
7
|
{
|
data/db/samples/orders.rb
CHANGED
@@ -12,7 +12,8 @@ orders << Spree::Order.create!(
|
|
12
12
|
adjustment_total: 150.95,
|
13
13
|
total: 301.90,
|
14
14
|
shipping_address: Spree::Address.first,
|
15
|
-
billing_address: Spree::Address.last
|
15
|
+
billing_address: Spree::Address.last
|
16
|
+
)
|
16
17
|
|
17
18
|
orders << Spree::Order.create!(
|
18
19
|
number: "R987654321",
|
@@ -21,17 +22,20 @@ orders << Spree::Order.create!(
|
|
21
22
|
adjustment_total: 15.95,
|
22
23
|
total: 31.90,
|
23
24
|
shipping_address: Spree::Address.first,
|
24
|
-
billing_address: Spree::Address.last
|
25
|
+
billing_address: Spree::Address.last
|
26
|
+
)
|
25
27
|
|
26
28
|
orders[0].line_items.create!(
|
27
|
-
variant: Spree::Product.
|
29
|
+
variant: Spree::Product.find_by!(name: "Ruby on Rails Tote").master,
|
28
30
|
quantity: 1,
|
29
|
-
price: 15.99
|
31
|
+
price: 15.99
|
32
|
+
)
|
30
33
|
|
31
34
|
orders[1].line_items.create!(
|
32
|
-
variant: Spree::Product.
|
35
|
+
variant: Spree::Product.find_by!(name: "Ruby on Rails Bag").master,
|
33
36
|
quantity: 1,
|
34
|
-
price: 22.99
|
37
|
+
price: 22.99
|
38
|
+
)
|
35
39
|
|
36
40
|
orders.each do |order|
|
37
41
|
order.payments.create!(payment_method: payment_method)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Spree::Sample.load_sample("products")
|
2
2
|
|
3
|
-
size = Spree::OptionType.
|
4
|
-
color = Spree::OptionType.
|
3
|
+
size = Spree::OptionType.find_by!(presentation: "Size")
|
4
|
+
color = Spree::OptionType.find_by!(presentation: "Color")
|
5
5
|
|
6
|
-
ror_baseball_jersey = Spree::Product.
|
6
|
+
ror_baseball_jersey = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
|
7
7
|
ror_baseball_jersey.option_types = [size, color]
|
8
8
|
ror_baseball_jersey.save!
|
data/db/samples/products.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Spree::Sample.load_sample("tax_categories")
|
2
2
|
Spree::Sample.load_sample("shipping_categories")
|
3
3
|
|
4
|
-
tax_category = Spree::TaxCategory.
|
5
|
-
shipping_category = Spree::ShippingCategory.
|
4
|
+
tax_category = Spree::TaxCategory.find_by!(name: "Default")
|
5
|
+
shipping_category = Spree::ShippingCategory.find_by!(name: "Default")
|
6
6
|
|
7
7
|
default_attrs = {
|
8
8
|
description: FFaker::Lorem.paragraph,
|
@@ -1,13 +1,13 @@
|
|
1
1
|
begin
|
2
|
-
north_america = Spree::Zone.
|
2
|
+
north_america = Spree::Zone.find_by!(name: "North America")
|
3
3
|
rescue ActiveRecord::RecordNotFound
|
4
4
|
puts "Couldn't find 'North America' zone. Did you run `rake db:seed` first?"
|
5
5
|
puts "That task will set up the countries, states and zones required for Spree."
|
6
6
|
exit
|
7
7
|
end
|
8
8
|
|
9
|
-
tax_category = Spree::TaxCategory.
|
10
|
-
europe_vat = Spree::Zone.
|
9
|
+
tax_category = Spree::TaxCategory.find_by!(name: "Default")
|
10
|
+
europe_vat = Spree::Zone.find_by!(name: "EU_VAT")
|
11
11
|
shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')
|
12
12
|
|
13
13
|
Spree::ShippingMethod.create!([
|
@@ -55,7 +55,7 @@ Spree::ShippingMethod.create!([
|
|
55
55
|
"UPS Two Day (USD)" => [10, "USD"],
|
56
56
|
"UPS Ground (EUR)" => [8, "EUR"]
|
57
57
|
}.each do |shipping_method_name, (price, currency)|
|
58
|
-
shipping_method = Spree::ShippingMethod.
|
58
|
+
shipping_method = Spree::ShippingMethod.find_by!(name: shipping_method_name)
|
59
59
|
shipping_method.calculator.preferences = {
|
60
60
|
amount: price,
|
61
61
|
currency: currency
|
data/db/samples/tax_rates.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
north_america = Spree::Zone.
|
2
|
-
clothing = Spree::TaxCategory.
|
1
|
+
north_america = Spree::Zone.find_by!(name: "North America")
|
2
|
+
clothing = Spree::TaxCategory.find_by!(name: "Default")
|
3
3
|
tax_rate = Spree::TaxRate.create(
|
4
4
|
name: "North America",
|
5
5
|
zone: north_america,
|
6
|
-
amount: 0.05
|
7
|
-
|
6
|
+
amount: 0.05
|
7
|
+
)
|
8
8
|
tax_rate.calculator = Spree::Calculator::DefaultTax.create!
|
9
9
|
tax_rate.save!
|
10
|
+
Spree::TaxRateTaxCategory.create!(
|
11
|
+
tax_rate: tax_rate,
|
12
|
+
tax_category: clothing
|
13
|
+
)
|
data/db/samples/taxons.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Spree::Sample.load_sample("taxonomies")
|
2
2
|
Spree::Sample.load_sample("products")
|
3
3
|
|
4
|
-
categories = Spree::Taxonomy.
|
5
|
-
brands = Spree::Taxonomy.
|
4
|
+
categories = Spree::Taxonomy.find_by!(name: "Categories")
|
5
|
+
brands = Spree::Taxonomy.find_by!(name: "Brand")
|
6
6
|
|
7
7
|
products = {
|
8
8
|
ror_tote: "Ruby on Rails Tote",
|
@@ -17,7 +17,7 @@ products = {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
products.each do |key, name|
|
20
|
-
products[key] = Spree::Product.
|
20
|
+
products[key] = Spree::Product.find_by!(name: name)
|
21
21
|
end
|
22
22
|
|
23
23
|
taxons = [
|
@@ -110,7 +110,7 @@ taxons = [
|
|
110
110
|
|
111
111
|
taxons.each do |taxon_attrs|
|
112
112
|
if taxon_attrs[:parent]
|
113
|
-
taxon_attrs[:parent] = Spree::Taxon.
|
113
|
+
taxon_attrs[:parent] = Spree::Taxon.find_by!(name: taxon_attrs[:parent])
|
114
114
|
Spree::Taxon.create!(taxon_attrs)
|
115
115
|
end
|
116
116
|
end
|
data/db/samples/variants.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
Spree::Sample.load_sample("option_values")
|
2
2
|
Spree::Sample.load_sample("products")
|
3
3
|
|
4
|
-
ror_baseball_jersey = Spree::Product.
|
5
|
-
ror_tote = Spree::Product.
|
6
|
-
ror_bag = Spree::Product.
|
7
|
-
ror_jr_spaghetti = Spree::Product.
|
8
|
-
ror_mug = Spree::Product.
|
9
|
-
ror_ringer = Spree::Product.
|
10
|
-
ror_stein = Spree::Product.
|
11
|
-
ruby_baseball_jersey = Spree::Product.
|
12
|
-
apache_baseball_jersey = Spree::Product.
|
4
|
+
ror_baseball_jersey = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
|
5
|
+
ror_tote = Spree::Product.find_by!(name: "Ruby on Rails Tote")
|
6
|
+
ror_bag = Spree::Product.find_by!(name: "Ruby on Rails Bag")
|
7
|
+
ror_jr_spaghetti = Spree::Product.find_by!(name: "Ruby on Rails Jr. Spaghetti")
|
8
|
+
ror_mug = Spree::Product.find_by!(name: "Ruby on Rails Mug")
|
9
|
+
ror_ringer = Spree::Product.find_by!(name: "Ruby on Rails Ringer T-Shirt")
|
10
|
+
ror_stein = Spree::Product.find_by!(name: "Ruby on Rails Stein")
|
11
|
+
ruby_baseball_jersey = Spree::Product.find_by!(name: "Ruby Baseball Jersey")
|
12
|
+
apache_baseball_jersey = Spree::Product.find_by!(name: "Apache Baseball Jersey")
|
13
13
|
|
14
|
-
small = Spree::OptionValue.
|
15
|
-
medium = Spree::OptionValue.
|
16
|
-
large = Spree::OptionValue.
|
17
|
-
extra_large = Spree::OptionValue.
|
14
|
+
small = Spree::OptionValue.find_by!(name: "Small")
|
15
|
+
medium = Spree::OptionValue.find_by!(name: "Medium")
|
16
|
+
large = Spree::OptionValue.find_by!(name: "Large")
|
17
|
+
extra_large = Spree::OptionValue.find_by!(name: "Extra Large")
|
18
18
|
|
19
|
-
red = Spree::OptionValue.
|
20
|
-
blue = Spree::OptionValue.
|
21
|
-
green = Spree::OptionValue.
|
19
|
+
red = Spree::OptionValue.find_by!(name: "Red")
|
20
|
+
blue = Spree::OptionValue.find_by!(name: "Blue")
|
21
|
+
green = Spree::OptionValue.find_by!(name: "Green")
|
22
22
|
|
23
23
|
variants = [
|
24
24
|
{
|
data/spec/spec_helper.rb
CHANGED
@@ -23,14 +23,14 @@ RSpec.configure do |config|
|
|
23
23
|
c.syntax = :expect
|
24
24
|
end
|
25
25
|
|
26
|
-
config.before(:
|
26
|
+
config.before(:each) do
|
27
27
|
DatabaseCleaner.clean_with(:truncation)
|
28
28
|
end
|
29
29
|
|
30
30
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
31
31
|
# examples within a transaction, comment the following line or assign false
|
32
32
|
# instead of true.
|
33
|
-
config.use_transactional_fixtures =
|
33
|
+
config.use_transactional_fixtures = false
|
34
34
|
|
35
35
|
config.include FactoryGirl::Syntax::Methods
|
36
36
|
config.fail_fast = ENV['FAIL_FAST'] || false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_sample
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.3.0.beta1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.3.0.beta1
|
27
27
|
description: Sample data (including images) for use with Solidus.
|
28
28
|
email: contact@solidus.io
|
29
29
|
executables: []
|