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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca6ca6b9fce832a4200e8112861ce092ae3316b0
4
- data.tar.gz: b4337071c9a5e699486a674edb69a5ac2f171ef4
3
+ metadata.gz: 738dadf7d78a796d7143f42149d3b2ce1ab1af16
4
+ data.tar.gz: 354f73b3a2fc49f4229783b637199ae82103af8a
5
5
  SHA512:
6
- metadata.gz: 408ffe1e5387c70b11bd3092c7b9035cea964aab0c6790f3e6df31d6d7c36b98c7af4d6761ae48830a05b26ffc102550cc260b9af515a1cdb0da2325b1b9f3f1
7
- data.tar.gz: 45648a9f31fd97a591679c01c013d2f7ecbad34ee2a0cc4cb132b4d89cadf3abe28501fcf970fd5ee2e254517c03c5ff15aa5ddb09f18f6189d128283441934e
6
+ metadata.gz: 5259942c3ce4c04c19e4967f49fbd1cc940ae624b541aa5d4e48bbdf3bcdae4ef382ecbba94ba90ed76e74827c8df0d24e87aca35ad09e80d4ea2c6cd940b24c
7
+ data.tar.gz: 1dea108fcfd30e96b82a434364cfcd5968591c1bc929e177286f652240fa2fc5cd73dc0aa632f37d7169f4145a0bb5e1ff2900f70a7ed66f0e6670c538aed20f
@@ -1,5 +1,5 @@
1
- united_states = Spree::Country.find_by_iso!("US")
2
- new_york = Spree::State.find_by_name!("New York")
1
+ united_states = Spree::Country.find_by!(iso: "US")
2
+ new_york = Spree::State.find_by!(name: "New York")
3
3
 
4
4
  # Billing address
5
5
  Spree::Address.create!(
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.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")
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"
@@ -1,7 +1,7 @@
1
1
  Spree::Sample.load_sample("option_types")
2
2
 
3
- size = Spree::OptionType.find_by_presentation!("Size")
4
- color = Spree::OptionType.find_by_presentation!("Color")
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.find_by_name!("Ruby on Rails Tote").master,
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.find_by_name!("Ruby on Rails Bag").master,
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,4 +1,4 @@
1
- Spree::Gateway::Bogus.create!(
1
+ Spree::PaymentMethod::BogusCreditCard.create!(
2
2
  {
3
3
  name: "Credit Card",
4
4
  description: "Bogus payment gateway",
@@ -1,8 +1,8 @@
1
1
  Spree::Sample.load_sample("products")
2
2
 
3
- size = Spree::OptionType.find_by_presentation!("Size")
4
- color = Spree::OptionType.find_by_presentation!("Color")
3
+ size = Spree::OptionType.find_by!(presentation: "Size")
4
+ color = Spree::OptionType.find_by!(presentation: "Color")
5
5
 
6
- ror_baseball_jersey = Spree::Product.find_by_name!("Ruby on Rails Baseball Jersey")
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!
@@ -58,7 +58,7 @@ products =
58
58
  }
59
59
 
60
60
  products.each do |name, properties|
61
- product = Spree::Product.find_by_name(name)
61
+ product = Spree::Product.find_by(name: name)
62
62
  properties.each do |prop_name, prop_value|
63
63
  product.set_property(prop_name, prop_value)
64
64
  end
@@ -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.find_by_name!("Default")
5
- shipping_category = Spree::ShippingCategory.find_by_name!("Default")
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.find_by_name!("North America")
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.find_by_name!("Default")
10
- europe_vat = Spree::Zone.find_by_name!("EU_VAT")
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.find_by_name!(shipping_method_name)
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
@@ -1,9 +1,13 @@
1
- north_america = Spree::Zone.find_by_name!("North America")
2
- clothing = Spree::TaxCategory.find_by_name!("Default")
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
- tax_category: clothing)
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.find_by_name!("Categories")
5
- brands = Spree::Taxonomy.find_by_name!("Brand")
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.find_by_name!(name)
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.find_by_name!(taxon_attrs[:parent])
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
@@ -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.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")
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.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")
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.find_by_name!("Red")
20
- blue = Spree::OptionValue.find_by_name!("Blue")
21
- green = Spree::OptionValue.find_by_name!("Green")
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(:suite) do
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 = true
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.2.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-12-12 00:00:00.000000000 Z
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.2.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.2.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: []