spree_sample 3.2.9 → 3.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d16781c1e772f90d0b361d46c264c72db74f2d28
4
- data.tar.gz: 09a370100054555363208afbd2228e943062c9f9
3
+ metadata.gz: ac8f170126b879e3866cf0d4bd0ae9e5035a365a
4
+ data.tar.gz: dec97570a44836cfa46e0d4c290aa9eb9b34c769
5
5
  SHA512:
6
- metadata.gz: e99e8d0171c155742dfa3f4495eb060111f360a70db7be01358d31d97901d9cf02cdad836a40e1d069e3c6d84522b86936f432216b131e4d5510bb48bc97d4ce
7
- data.tar.gz: a39cf9272b473f39b82e9a5a69e2dfe07f9b5941aa2d86560b44005e449a90dfdd85148809706123a25dcbc4bef74f1ac257b7806899d45747714b2084180c8e
6
+ metadata.gz: c49f9ede80e534583a04c7901ab9ed5e99d9dc78ad3171a2f39285ffaa8a769932e99d80fae5ad960947cc910008225bb3fc704a58cc902a50cef22f793143b8
7
+ data.tar.gz: 17f49da0a71e5699628f6cf9293a579b10b1ae072c3337ba10da8b8be363ac9bcae959e5e381282d735df6338361bbfe23b2d11105bf05600597966019ef7fda
@@ -1,7 +1,7 @@
1
1
  Spree::Sample.load_sample("orders")
2
2
 
3
- first_order = Spree::Order.find_by_number!("R123456789")
4
- last_order = Spree::Order.find_by_number!("R987654321")
3
+ first_order = Spree::Order.find_by!(number: "R123456789")
4
+ last_order = Spree::Order.find_by!(number: "R987654321")
5
5
 
6
6
  first_order.adjustments.where(
7
7
  source: Spree::TaxRate.find_by_name!("North America"),
@@ -13,26 +13,31 @@ shipping_methods = [
13
13
  {
14
14
  name: "UPS Ground (USD)",
15
15
  zones: [north_america],
16
+ display_on: 'both',
16
17
  shipping_categories: [shipping_category]
17
18
  },
18
19
  {
19
20
  name: "UPS Two Day (USD)",
20
21
  zones: [north_america],
22
+ display_on: 'both',
21
23
  shipping_categories: [shipping_category]
22
24
  },
23
25
  {
24
26
  name: "UPS One Day (USD)",
25
27
  zones: [north_america],
28
+ display_on: 'both',
26
29
  shipping_categories: [shipping_category]
27
30
  },
28
31
  {
29
32
  name: "UPS Ground (EU)",
30
33
  zones: [europe_vat],
34
+ display_on: 'both',
31
35
  shipping_categories: [shipping_category]
32
36
  },
33
37
  {
34
38
  name: "UPS Ground (EUR)",
35
39
  zones: [europe_vat],
40
+ display_on: 'both',
36
41
  shipping_categories: [shipping_category]
37
42
  }
38
43
  ]
@@ -41,6 +46,7 @@ shipping_methods.each do |attributes|
41
46
  Spree::ShippingMethod.where(name: attributes[:name]).first_or_create! do |shipping_method|
42
47
  shipping_method.calculator = Spree::Calculator::Shipping::FlatRate.create!
43
48
  shipping_method.zones = attributes[:zones]
49
+ shipping_method.display_on = attributes[:display_on]
44
50
  shipping_method.shipping_categories = attributes[:shipping_categories]
45
51
  end
46
52
  end
@@ -1,6 +1,6 @@
1
1
  taxonomies = [
2
- { name: I18n.t('spree.taxonomy_brands_name') },
3
- { name: "Brand" }
2
+ { name: I18n.t('spree.taxonomy_categories_name') },
3
+ { name: I18n.t('spree.taxonomy_brands_name') }
4
4
  ]
5
5
 
6
6
  taxonomies.each do |taxonomy_attrs|
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!(I18n.t('spree.taxonomy_brands_name'))
5
- brands = Spree::Taxonomy.find_by_name!("Brand")
4
+ categories = Spree::Taxonomy.find_by_name!(I18n.t('spree.taxonomy_categories_name'))
5
+ brands = Spree::Taxonomy.find_by_name!(I18n.t('spree.taxonomy_brands_name'))
6
6
 
7
7
  products = {
8
8
  ror_tote: "Ruby on Rails Tote",
@@ -29,14 +29,14 @@ end
29
29
 
30
30
  taxons = [
31
31
  {
32
- name: I18n.t('spree.taxonomy_brands_name'),
32
+ name: I18n.t('spree.taxonomy_categories_name'),
33
33
  taxonomy: categories,
34
34
  position: 0
35
35
  },
36
36
  {
37
37
  name: "Bags",
38
38
  taxonomy: categories,
39
- parent: I18n.t('spree.taxonomy_brands_name'),
39
+ parent: I18n.t('spree.taxonomy_categories_name'),
40
40
  position: 1,
41
41
  products: [
42
42
  products[:ror_tote],
@@ -48,7 +48,7 @@ taxons = [
48
48
  {
49
49
  name: "Mugs",
50
50
  taxonomy: categories,
51
- parent: I18n.t('spree.taxonomy_brands_name'),
51
+ parent: I18n.t('spree.taxonomy_categories_name'),
52
52
  position: 2,
53
53
  products: [
54
54
  products[:ror_mug],
@@ -60,7 +60,7 @@ taxons = [
60
60
  {
61
61
  name: "Clothing",
62
62
  taxonomy: categories,
63
- parent: I18n.t('spree.taxonomy_brands_name')
63
+ parent: I18n.t('spree.taxonomy_categories_name')
64
64
  },
65
65
  {
66
66
  name: "Shirts",
@@ -20,5 +20,3 @@ Migrations have been run. Please run "rake spree_sample:load" by itself now.
20
20
  SpreeSample::Engine.load_samples
21
21
  end
22
22
  end
23
-
24
-
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Load samples" do
4
+ before do
5
+ # Seeds are only run for rake test_app so to allow this spec to pass without
6
+ # rerunning rake test_app every time we must load them in if not already.
7
+ unless Spree::Zone.find_by_name("North America")
8
+ load Rails.root + 'Rakefile'
9
+ load Rails.root + 'db/seeds.rb'
10
+ end
11
+ end
12
+
13
+ it "doesn't raise any error" do
14
+ expect {
15
+ SpreeSample::Engine.load_samples
16
+ }.to_not raise_error
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ # This file is copied to ~/spec when you run 'ruby script/generate rspec'
2
+ # from the project root directory.
3
+ ENV["RAILS_ENV"] ||= 'test'
4
+ require File.expand_path("../dummy/config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+ require 'ffaker'
7
+ require 'spree_sample'
8
+ require 'spree/testing_support/shoulda_matcher_configuration'
9
+
10
+ RSpec.configure do |config|
11
+ config.color = true
12
+ config.fail_fast = ENV['FAIL_FAST'] || false
13
+ config.infer_spec_type_from_file_location!
14
+ config.mock_with :rspec
15
+ config.raise_errors_for_deprecations!
16
+
17
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
18
+ # examples within a transaction, comment the following line or assign false
19
+ # instead of true.
20
+ config.use_transactional_fixtures = true
21
+
22
+ config.include FactoryGirl::Syntax::Methods
23
+
24
+ config.order = :random
25
+ Kernel.srand config.seed
26
+ end
data/spree_sample.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.homepage = 'http://spreecommerce.com'
14
14
  s.license = 'BSD-3-Clause'
15
15
 
16
- s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
16
+ s.files = `git ls-files`.split("\n")
17
17
  s.require_path = 'lib'
18
18
  s.requirements << 'none'
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_sample
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.9
4
+ version: 3.3.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2017-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.9
19
+ version: 3.3.0.rc1
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: 3.2.9
26
+ version: 3.3.0.rc1
27
27
  description: Required dependency for Spree
28
28
  email: sean@spreecommerce.com
29
29
  executables: []
@@ -90,6 +90,8 @@ files:
90
90
  - lib/spree/sample.rb
91
91
  - lib/spree_sample.rb
92
92
  - lib/tasks/sample.rake
93
+ - spec/lib/load_sample_spec.rb
94
+ - spec/spec_helper.rb
93
95
  - spree_sample.gemspec
94
96
  homepage: http://spreecommerce.com
95
97
  licenses:
@@ -106,13 +108,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
108
  version: '0'
107
109
  required_rubygems_version: !ruby/object:Gem::Requirement
108
110
  requirements:
109
- - - ">="
111
+ - - ">"
110
112
  - !ruby/object:Gem::Version
111
- version: '0'
113
+ version: 1.3.1
112
114
  requirements:
113
115
  - none
114
116
  rubyforge_project:
115
- rubygems_version: 2.6.10
117
+ rubygems_version: 2.6.12
116
118
  signing_key:
117
119
  specification_version: 4
118
120
  summary: Sample data (including images) for use with Spree.