solidus_sample 2.10.3 → 2.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/samples/addresses.rb +5 -8
- data/db/samples/assets.rb +0 -21
- data/db/samples/images/ruby_polo.jpg +0 -0
- data/db/samples/images/ruby_polo_back.jpg +0 -0
- data/db/samples/orders.rb +2 -2
- data/db/samples/reimbursements.rb +35 -12
- data/solidus_sample.gemspec +5 -5
- metadata +7 -10
- data/spec/lib/load_sample_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f826094223c05a3989c35e5432ae7eb0eb82a9c285b05688240df5fa791c9f3c
|
4
|
+
data.tar.gz: 74e2199b7a816795714b216107cb8834d0275ebcdbe6b776ddd8b40fed28eaba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57468ff1ddb5605d7de00d54d89c0645a209d1353d2273bf50db4ec98354f23acaf974c63d075a28e8e3928abed7101fdf564e75d232ef02e2cfb3267c4dbaab
|
7
|
+
data.tar.gz: '090a1731d18841b19f7ffddcbefa983e48bb44c2124cd8e0036b512997d6784ce845c6401e946eeaefe7827877ade791b3580abdaa7a021be0c51ded526e1b61'
|
data/db/samples/addresses.rb
CHANGED
@@ -3,12 +3,10 @@
|
|
3
3
|
united_states = Spree::Country.find_by!(iso: "US")
|
4
4
|
new_york = Spree::State.find_by!(name: "New York")
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
"Torp", "Gutmann", "Renner", "Bergstrom", "Sauer", "Gaylord",
|
11
|
-
"Mills", "Daugherty", "Stark"]
|
6
|
+
names = ["Sterling Torp", "Jennette Vandervort", "Salome Stroman", "Lyla Lang",
|
7
|
+
"Lola Zulauf", "Cheree Bruen", "Hettie Torp", "Barbie Gutmann",
|
8
|
+
"Amelia Renner", "Marceline Bergstrom", "Keeley Sauer", "Mi Gaylord",
|
9
|
+
"Karon Mills", "Jessika Daugherty", "Emmy Stark"]
|
12
10
|
street_addresses = ["7377 Jacobi Passage", "4725 Serena Ridges",
|
13
11
|
"79832 Hamill Creek", "0746 Genoveva Villages",
|
14
12
|
"86717 D'Amore Hollow", "8529 Delena Well",
|
@@ -28,8 +26,7 @@ phone_numbers = ["(392)859-7319 x670", "738-831-3210 x6047",
|
|
28
26
|
|
29
27
|
2.times do
|
30
28
|
Spree::Address.create!(
|
31
|
-
|
32
|
-
lastname: last_names.sample,
|
29
|
+
name: names.sample,
|
33
30
|
address1: street_addresses.sample,
|
34
31
|
address2: secondary_addresses.sample,
|
35
32
|
city: cities.sample,
|
data/db/samples/assets.rb
CHANGED
@@ -27,22 +27,6 @@ def image(name, type = "jpg")
|
|
27
27
|
end
|
28
28
|
|
29
29
|
images = {
|
30
|
-
products[:solidus_tshirt].master => [
|
31
|
-
{
|
32
|
-
attachment: image("solidus_tshirt")
|
33
|
-
},
|
34
|
-
{
|
35
|
-
attachment: image("solidus_tshirt_back")
|
36
|
-
}
|
37
|
-
],
|
38
|
-
products[:solidus_long].master => [
|
39
|
-
{
|
40
|
-
attachment: image("solidus_long")
|
41
|
-
},
|
42
|
-
{
|
43
|
-
attachment: image("solidus_long_back")
|
44
|
-
}
|
45
|
-
],
|
46
30
|
products[:solidus_snapback_cap].master => [
|
47
31
|
{
|
48
32
|
attachment: image("solidus_snapback_cap")
|
@@ -90,11 +74,6 @@ images = {
|
|
90
74
|
{
|
91
75
|
attachment: image("tote_bag_ruby")
|
92
76
|
}
|
93
|
-
],
|
94
|
-
products[:solidus_girly].master => [
|
95
|
-
{
|
96
|
-
attachment: image("solidus_girly")
|
97
|
-
}
|
98
77
|
]
|
99
78
|
}
|
100
79
|
|
Binary file
|
Binary file
|
data/db/samples/orders.rb
CHANGED
@@ -9,7 +9,7 @@ store = Spree::Store.first!
|
|
9
9
|
orders = []
|
10
10
|
orders << Spree::Order.create!(
|
11
11
|
number: "R123456789",
|
12
|
-
email: "
|
12
|
+
email: "solidus@example.com",
|
13
13
|
item_total: 150.95,
|
14
14
|
adjustment_total: 150.95,
|
15
15
|
total: 301.90,
|
@@ -19,7 +19,7 @@ orders << Spree::Order.create!(
|
|
19
19
|
|
20
20
|
orders << Spree::Order.create!(
|
21
21
|
number: "R987654321",
|
22
|
-
email: "
|
22
|
+
email: "solidus@example.com",
|
23
23
|
item_total: 15.95,
|
24
24
|
adjustment_total: 15.95,
|
25
25
|
total: 31.90,
|
@@ -2,22 +2,45 @@
|
|
2
2
|
|
3
3
|
Spree::Sample.load_sample("orders")
|
4
4
|
|
5
|
-
order
|
6
|
-
inventory_unit = order.inventory_units.
|
5
|
+
order = Spree::Order.last
|
6
|
+
inventory_unit = order.inventory_units.take!
|
7
7
|
stock_location = inventory_unit.find_stock_item.stock_location
|
8
|
+
return_reason = Spree::ReturnReason.active.take!
|
9
|
+
preferred_reimbursement_type = Spree::ReimbursementType.where(name: 'Original').take!
|
10
|
+
admin_user = if defined?(Spree::Auth)
|
11
|
+
Spree.user_class.admin.take!
|
12
|
+
else
|
13
|
+
Spree.user_class.find_or_create_by!(email: 'admin@example.com')
|
14
|
+
end
|
8
15
|
|
9
|
-
|
16
|
+
# Mark the order paid and shipped
|
17
|
+
order.payments.pending.each(&:complete)
|
18
|
+
order.shipments.each do |shipment|
|
19
|
+
shipment.suppress_mailer = false
|
20
|
+
shipment.ship!
|
21
|
+
end
|
10
22
|
|
11
|
-
|
12
|
-
return_item.
|
13
|
-
|
23
|
+
# Create a return authorization
|
24
|
+
return_item = Spree::ReturnItem.new(
|
25
|
+
inventory_unit: inventory_unit,
|
26
|
+
preferred_reimbursement_type: preferred_reimbursement_type
|
27
|
+
)
|
14
28
|
|
15
|
-
|
16
|
-
|
17
|
-
return_items: [return_item]
|
29
|
+
order.return_authorizations.create!(
|
30
|
+
reason: return_reason,
|
31
|
+
return_items: [return_item],
|
32
|
+
stock_location: stock_location
|
18
33
|
)
|
19
34
|
|
20
|
-
|
21
|
-
|
22
|
-
return_items: [return_item]
|
35
|
+
# Create a customer return and mark it as received
|
36
|
+
customer_return = Spree::CustomerReturn.create!(
|
37
|
+
return_items: [return_item],
|
38
|
+
stock_location: stock_location
|
23
39
|
)
|
40
|
+
return_item.reload
|
41
|
+
return_item.receive!
|
42
|
+
customer_return.process_return!
|
43
|
+
|
44
|
+
# Accept the customer return and reimburse it
|
45
|
+
reimbursement = Spree::Reimbursement.build_from_customer_return(customer_return)
|
46
|
+
reimbursement.return_all(created_by: admin_user)
|
data/solidus_sample.gemspec
CHANGED
@@ -11,14 +11,14 @@ Gem::Specification.new do |s|
|
|
11
11
|
|
12
12
|
s.author = 'Solidus Team'
|
13
13
|
s.email = 'contact@solidus.io'
|
14
|
-
s.homepage = 'http://solidus.io
|
14
|
+
s.homepage = 'http://solidus.io'
|
15
15
|
s.license = 'BSD-3-Clause'
|
16
16
|
|
17
|
-
s.files
|
18
|
-
|
19
|
-
|
17
|
+
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(spec|script)/})
|
19
|
+
end
|
20
20
|
|
21
|
-
s.required_ruby_version = '>= 2.
|
21
|
+
s.required_ruby_version = '>= 2.5.0'
|
22
22
|
s.required_rubygems_version = '>= 1.8.23'
|
23
23
|
|
24
24
|
s.add_dependency 'solidus_core', s.version
|
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.11.4
|
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: 2021-01-19 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.11.4
|
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.11.4
|
27
27
|
description: Sample data (including images) for use with Solidus.
|
28
28
|
email: contact@solidus.io
|
29
29
|
executables: []
|
@@ -89,9 +89,7 @@ files:
|
|
89
89
|
- lib/spree_sample.rb
|
90
90
|
- lib/tasks/sample.rake
|
91
91
|
- solidus_sample.gemspec
|
92
|
-
|
93
|
-
- spec/spec_helper.rb
|
94
|
-
homepage: http://solidus.io/
|
92
|
+
homepage: http://solidus.io
|
95
93
|
licenses:
|
96
94
|
- BSD-3-Clause
|
97
95
|
metadata: {}
|
@@ -103,14 +101,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
101
|
requirements:
|
104
102
|
- - ">="
|
105
103
|
- !ruby/object:Gem::Version
|
106
|
-
version: 2.
|
104
|
+
version: 2.5.0
|
107
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
106
|
requirements:
|
109
107
|
- - ">="
|
110
108
|
- !ruby/object:Gem::Version
|
111
109
|
version: 1.8.23
|
112
|
-
requirements:
|
113
|
-
- none
|
110
|
+
requirements: []
|
114
111
|
rubygems_version: 3.1.4
|
115
112
|
signing_key:
|
116
113
|
specification_version: 4
|
data/spec/spec_helper.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
4
|
-
# from the project root directory.
|
5
|
-
ENV["RAILS_ENV"] ||= 'test'
|
6
|
-
|
7
|
-
require 'solidus_sample'
|
8
|
-
require 'spree/testing_support/dummy_app'
|
9
|
-
DummyApp.setup(
|
10
|
-
gem_root: File.expand_path('..', __dir__),
|
11
|
-
lib_name: 'solidus_sample'
|
12
|
-
)
|
13
|
-
|
14
|
-
require 'rspec/rails'
|
15
|
-
require 'database_cleaner'
|
16
|
-
|
17
|
-
RSpec.configure do |config|
|
18
|
-
config.color = true
|
19
|
-
config.infer_spec_type_from_file_location!
|
20
|
-
config.expect_with :rspec do |c|
|
21
|
-
c.syntax = :expect
|
22
|
-
end
|
23
|
-
config.mock_with :rspec do |c|
|
24
|
-
c.syntax = :expect
|
25
|
-
end
|
26
|
-
|
27
|
-
config.before(:each) do
|
28
|
-
DatabaseCleaner.clean_with(:truncation)
|
29
|
-
end
|
30
|
-
|
31
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
32
|
-
# examples within a transaction, comment the following line or assign false
|
33
|
-
# instead of true.
|
34
|
-
config.use_transactional_fixtures = false
|
35
|
-
|
36
|
-
config.example_status_persistence_file_path = "./spec/examples.txt"
|
37
|
-
|
38
|
-
config.order = :random
|
39
|
-
|
40
|
-
Kernel.srand config.seed
|
41
|
-
end
|