solidus_sample_devise_token_auth 2.8.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README.md +20 -0
- data/Rakefile +16 -0
- data/db/samples/addresses.rb +41 -0
- data/db/samples/assets.rb +107 -0
- data/db/samples/images/apache_baseball.png +0 -0
- data/db/samples/images/ror_bag.jpeg +0 -0
- data/db/samples/images/ror_baseball.jpeg +0 -0
- data/db/samples/images/ror_baseball_back.jpeg +0 -0
- data/db/samples/images/ror_baseball_jersey_back_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_back_red.png +0 -0
- data/db/samples/images/ror_baseball_jersey_blue.png +0 -0
- data/db/samples/images/ror_baseball_jersey_green.png +0 -0
- data/db/samples/images/ror_baseball_jersey_red.png +0 -0
- data/db/samples/images/ror_jr_spaghetti.jpeg +0 -0
- data/db/samples/images/ror_mug.jpeg +0 -0
- data/db/samples/images/ror_mug_back.jpeg +0 -0
- data/db/samples/images/ror_ringer.jpeg +0 -0
- data/db/samples/images/ror_ringer_back.jpeg +0 -0
- data/db/samples/images/ror_stein.jpeg +0 -0
- data/db/samples/images/ror_stein_back.jpeg +0 -0
- data/db/samples/images/ror_tote.jpeg +0 -0
- data/db/samples/images/ror_tote_back.jpeg +0 -0
- data/db/samples/images/ruby_baseball.png +0 -0
- data/db/samples/option_types.rb +14 -0
- data/db/samples/option_values.rb +51 -0
- data/db/samples/orders.rb +48 -0
- data/db/samples/payment_methods.rb +17 -0
- data/db/samples/payments.rb +17 -0
- data/db/samples/product_option_types.rb +10 -0
- data/db/samples/product_properties.rb +67 -0
- data/db/samples/products.rb +100 -0
- data/db/samples/reimbursements.rb +23 -0
- data/db/samples/shipping_categories.rb +3 -0
- data/db/samples/shipping_methods.rb +67 -0
- data/db/samples/stock.rb +14 -0
- data/db/samples/stores.rb +10 -0
- data/db/samples/tax_categories.rb +3 -0
- data/db/samples/tax_rates.rb +15 -0
- data/db/samples/taxonomies.rb +10 -0
- data/db/samples/taxons.rb +118 -0
- data/db/samples/variants.rb +131 -0
- data/db/samples.rb +4 -0
- data/lib/solidus_sample.rb +3 -0
- data/lib/spree/sample.rb +29 -0
- data/lib/spree_sample.rb +32 -0
- data/lib/tasks/sample.rake +23 -0
- data/solidus_sample.gemspec +25 -0
- data/spec/lib/load_sample_spec.rb +12 -0
- data/spec/spec_helper.rb +41 -0
- metadata +111 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
north_america = Spree::Zone.find_by!(name: "North America")
|
5
|
+
rescue ActiveRecord::RecordNotFound
|
6
|
+
puts "Couldn't find 'North America' zone. Did you run `rake db:seed` first?"
|
7
|
+
puts "That task will set up the countries, states and zones required for Spree."
|
8
|
+
exit
|
9
|
+
end
|
10
|
+
|
11
|
+
tax_category = Spree::TaxCategory.find_by!(name: "Default")
|
12
|
+
europe_vat = Spree::Zone.find_by!(name: "EU_VAT")
|
13
|
+
shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')
|
14
|
+
|
15
|
+
Spree::ShippingMethod.create!([
|
16
|
+
{
|
17
|
+
name: "UPS Ground (USD)",
|
18
|
+
zones: [north_america],
|
19
|
+
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
20
|
+
tax_category: tax_category,
|
21
|
+
shipping_categories: [shipping_category]
|
22
|
+
},
|
23
|
+
{
|
24
|
+
name: "UPS Two Day (USD)",
|
25
|
+
zones: [north_america],
|
26
|
+
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
27
|
+
tax_category: tax_category,
|
28
|
+
shipping_categories: [shipping_category]
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: "UPS One Day (USD)",
|
32
|
+
zones: [north_america],
|
33
|
+
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
34
|
+
tax_category: tax_category,
|
35
|
+
shipping_categories: [shipping_category]
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: "UPS Ground (EU)",
|
39
|
+
zones: [europe_vat],
|
40
|
+
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
41
|
+
tax_category: tax_category,
|
42
|
+
shipping_categories: [shipping_category]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: "UPS Ground (EUR)",
|
46
|
+
zones: [europe_vat],
|
47
|
+
calculator: Spree::Calculator::Shipping::FlatRate.create!,
|
48
|
+
tax_category: tax_category,
|
49
|
+
shipping_categories: [shipping_category]
|
50
|
+
}
|
51
|
+
])
|
52
|
+
|
53
|
+
{
|
54
|
+
"UPS Ground (USD)" => [5, "USD"],
|
55
|
+
"UPS Ground (EU)" => [5, "USD"],
|
56
|
+
"UPS One Day (USD)" => [15, "USD"],
|
57
|
+
"UPS Two Day (USD)" => [10, "USD"],
|
58
|
+
"UPS Ground (EUR)" => [8, "EUR"]
|
59
|
+
}.each do |shipping_method_name, (price, currency)|
|
60
|
+
shipping_method = Spree::ShippingMethod.find_by!(name: shipping_method_name)
|
61
|
+
shipping_method.calculator.preferences = {
|
62
|
+
amount: price,
|
63
|
+
currency: currency
|
64
|
+
}
|
65
|
+
shipping_method.calculator.save!
|
66
|
+
shipping_method.save!
|
67
|
+
end
|
data/db/samples/stock.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Spree::Sample.load_sample("variants")
|
4
|
+
|
5
|
+
country = Spree::Country.find_by(iso: 'US')
|
6
|
+
location = Spree::StockLocation.first_or_create! name: 'default', address1: 'Example Street', city: 'City', zipcode: '12345', country: country, state: country.states.first
|
7
|
+
location.active = true
|
8
|
+
location.save!
|
9
|
+
|
10
|
+
Spree::Variant.all.each do |variant|
|
11
|
+
variant.stock_items.each do |stock_item|
|
12
|
+
Spree::StockMovement.create(quantity: 10, stock_item: stock_item)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
north_america = Spree::Zone.find_by!(name: "North America")
|
4
|
+
clothing = Spree::TaxCategory.find_by!(name: "Default")
|
5
|
+
tax_rate = Spree::TaxRate.create(
|
6
|
+
name: "North America",
|
7
|
+
zone: north_america,
|
8
|
+
amount: 0.05
|
9
|
+
)
|
10
|
+
tax_rate.calculator = Spree::Calculator::DefaultTax.create!
|
11
|
+
tax_rate.save!
|
12
|
+
Spree::TaxRateTaxCategory.create!(
|
13
|
+
tax_rate: tax_rate,
|
14
|
+
tax_category: clothing
|
15
|
+
)
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Spree::Sample.load_sample("taxonomies")
|
4
|
+
Spree::Sample.load_sample("products")
|
5
|
+
|
6
|
+
categories = Spree::Taxonomy.find_by!(name: "Categories")
|
7
|
+
brands = Spree::Taxonomy.find_by!(name: "Brand")
|
8
|
+
|
9
|
+
products = {
|
10
|
+
ror_tote: "Ruby on Rails Tote",
|
11
|
+
ror_bag: "Ruby on Rails Bag",
|
12
|
+
ror_mug: "Ruby on Rails Mug",
|
13
|
+
ror_stein: "Ruby on Rails Stein",
|
14
|
+
ror_baseball_jersey: "Ruby on Rails Baseball Jersey",
|
15
|
+
ror_jr_spaghetti: "Ruby on Rails Jr. Spaghetti",
|
16
|
+
ror_ringer: "Ruby on Rails Ringer T-Shirt",
|
17
|
+
apache_baseball_jersey: "Apache Baseball Jersey",
|
18
|
+
ruby_baseball_jersey: "Ruby Baseball Jersey"
|
19
|
+
}
|
20
|
+
|
21
|
+
products.each do |key, name|
|
22
|
+
products[key] = Spree::Product.find_by!(name: name)
|
23
|
+
end
|
24
|
+
|
25
|
+
taxons = [
|
26
|
+
{
|
27
|
+
name: "Categories",
|
28
|
+
taxonomy: categories,
|
29
|
+
position: 0
|
30
|
+
},
|
31
|
+
{
|
32
|
+
name: "Bags",
|
33
|
+
taxonomy: categories,
|
34
|
+
parent: "Categories",
|
35
|
+
position: 1,
|
36
|
+
products: [
|
37
|
+
products[:ror_tote],
|
38
|
+
products[:ror_bag]
|
39
|
+
]
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: "Mugs",
|
43
|
+
taxonomy: categories,
|
44
|
+
parent: "Categories",
|
45
|
+
position: 2,
|
46
|
+
products: [
|
47
|
+
products[:ror_mug],
|
48
|
+
products[:ror_stein]
|
49
|
+
]
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: "Clothing",
|
53
|
+
taxonomy: categories,
|
54
|
+
parent: "Categories"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
name: "Shirts",
|
58
|
+
taxonomy: categories,
|
59
|
+
parent: "Clothing",
|
60
|
+
position: 0,
|
61
|
+
products: [
|
62
|
+
products[:ror_jr_spaghetti]
|
63
|
+
]
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: "T-Shirts",
|
67
|
+
taxonomy: categories,
|
68
|
+
parent: "Clothing",
|
69
|
+
products: [
|
70
|
+
products[:ror_baseball_jersey],
|
71
|
+
products[:ror_ringer],
|
72
|
+
products[:apache_baseball_jersey],
|
73
|
+
products[:ruby_baseball_jersey]
|
74
|
+
],
|
75
|
+
position: 0
|
76
|
+
},
|
77
|
+
{
|
78
|
+
name: "Brands",
|
79
|
+
taxonomy: brands
|
80
|
+
},
|
81
|
+
{
|
82
|
+
name: "Ruby",
|
83
|
+
taxonomy: brands,
|
84
|
+
parent: "Brand",
|
85
|
+
products: [
|
86
|
+
products[:ruby_baseball_jersey]
|
87
|
+
]
|
88
|
+
},
|
89
|
+
{
|
90
|
+
name: "Apache",
|
91
|
+
taxonomy: brands,
|
92
|
+
parent: "Brand",
|
93
|
+
products: [
|
94
|
+
products[:apache_baseball_jersey]
|
95
|
+
]
|
96
|
+
},
|
97
|
+
{
|
98
|
+
name: "Rails",
|
99
|
+
taxonomy: brands,
|
100
|
+
parent: "Brand",
|
101
|
+
products: [
|
102
|
+
products[:ror_tote],
|
103
|
+
products[:ror_bag],
|
104
|
+
products[:ror_mug],
|
105
|
+
products[:ror_stein],
|
106
|
+
products[:ror_baseball_jersey],
|
107
|
+
products[:ror_jr_spaghetti],
|
108
|
+
products[:ror_ringer]
|
109
|
+
]
|
110
|
+
}
|
111
|
+
]
|
112
|
+
|
113
|
+
taxons.each do |taxon_attrs|
|
114
|
+
if taxon_attrs[:parent]
|
115
|
+
taxon_attrs[:parent] = Spree::Taxon.find_by!(name: taxon_attrs[:parent])
|
116
|
+
Spree::Taxon.create!(taxon_attrs)
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Spree::Sample.load_sample("option_values")
|
4
|
+
Spree::Sample.load_sample("products")
|
5
|
+
|
6
|
+
ror_baseball_jersey = Spree::Product.find_by!(name: "Ruby on Rails Baseball Jersey")
|
7
|
+
ror_tote = Spree::Product.find_by!(name: "Ruby on Rails Tote")
|
8
|
+
ror_bag = Spree::Product.find_by!(name: "Ruby on Rails Bag")
|
9
|
+
ror_jr_spaghetti = Spree::Product.find_by!(name: "Ruby on Rails Jr. Spaghetti")
|
10
|
+
ror_mug = Spree::Product.find_by!(name: "Ruby on Rails Mug")
|
11
|
+
ror_ringer = Spree::Product.find_by!(name: "Ruby on Rails Ringer T-Shirt")
|
12
|
+
ror_stein = Spree::Product.find_by!(name: "Ruby on Rails Stein")
|
13
|
+
ruby_baseball_jersey = Spree::Product.find_by!(name: "Ruby Baseball Jersey")
|
14
|
+
apache_baseball_jersey = Spree::Product.find_by!(name: "Apache Baseball Jersey")
|
15
|
+
|
16
|
+
small = Spree::OptionValue.find_by!(name: "Small")
|
17
|
+
medium = Spree::OptionValue.find_by!(name: "Medium")
|
18
|
+
large = Spree::OptionValue.find_by!(name: "Large")
|
19
|
+
extra_large = Spree::OptionValue.find_by!(name: "Extra Large")
|
20
|
+
|
21
|
+
red = Spree::OptionValue.find_by!(name: "Red")
|
22
|
+
blue = Spree::OptionValue.find_by!(name: "Blue")
|
23
|
+
green = Spree::OptionValue.find_by!(name: "Green")
|
24
|
+
|
25
|
+
variants = [
|
26
|
+
{
|
27
|
+
product: ror_baseball_jersey,
|
28
|
+
option_values: [small, red],
|
29
|
+
sku: "ROR-00001",
|
30
|
+
cost_price: 17
|
31
|
+
},
|
32
|
+
{
|
33
|
+
product: ror_baseball_jersey,
|
34
|
+
option_values: [small, blue],
|
35
|
+
sku: "ROR-00002",
|
36
|
+
cost_price: 17
|
37
|
+
},
|
38
|
+
{
|
39
|
+
product: ror_baseball_jersey,
|
40
|
+
option_values: [small, green],
|
41
|
+
sku: "ROR-00003",
|
42
|
+
cost_price: 17
|
43
|
+
},
|
44
|
+
{
|
45
|
+
product: ror_baseball_jersey,
|
46
|
+
option_values: [medium, red],
|
47
|
+
sku: "ROR-00004",
|
48
|
+
cost_price: 17
|
49
|
+
},
|
50
|
+
{
|
51
|
+
product: ror_baseball_jersey,
|
52
|
+
option_values: [medium, blue],
|
53
|
+
sku: "ROR-00005",
|
54
|
+
cost_price: 17
|
55
|
+
},
|
56
|
+
{
|
57
|
+
product: ror_baseball_jersey,
|
58
|
+
option_values: [medium, green],
|
59
|
+
sku: "ROR-00006",
|
60
|
+
cost_price: 17
|
61
|
+
},
|
62
|
+
{
|
63
|
+
product: ror_baseball_jersey,
|
64
|
+
option_values: [large, red],
|
65
|
+
sku: "ROR-00007",
|
66
|
+
cost_price: 17
|
67
|
+
},
|
68
|
+
{
|
69
|
+
product: ror_baseball_jersey,
|
70
|
+
option_values: [large, blue],
|
71
|
+
sku: "ROR-00008",
|
72
|
+
cost_price: 17
|
73
|
+
},
|
74
|
+
{
|
75
|
+
product: ror_baseball_jersey,
|
76
|
+
option_values: [large, green],
|
77
|
+
sku: "ROR-00009",
|
78
|
+
cost_price: 17
|
79
|
+
},
|
80
|
+
{
|
81
|
+
product: ror_baseball_jersey,
|
82
|
+
option_values: [extra_large, green],
|
83
|
+
sku: "ROR-00010",
|
84
|
+
cost_price: 17
|
85
|
+
}
|
86
|
+
]
|
87
|
+
|
88
|
+
masters = {
|
89
|
+
ror_baseball_jersey => {
|
90
|
+
sku: "ROR-001",
|
91
|
+
cost_price: 17
|
92
|
+
},
|
93
|
+
ror_tote => {
|
94
|
+
sku: "ROR-00011",
|
95
|
+
cost_price: 17
|
96
|
+
},
|
97
|
+
ror_bag => {
|
98
|
+
sku: "ROR-00012",
|
99
|
+
cost_price: 21
|
100
|
+
},
|
101
|
+
ror_jr_spaghetti => {
|
102
|
+
sku: "ROR-00013",
|
103
|
+
cost_price: 17
|
104
|
+
},
|
105
|
+
ror_mug => {
|
106
|
+
sku: "ROR-00014",
|
107
|
+
cost_price: 11
|
108
|
+
},
|
109
|
+
ror_ringer => {
|
110
|
+
sku: "ROR-00015",
|
111
|
+
cost_price: 17
|
112
|
+
},
|
113
|
+
ror_stein => {
|
114
|
+
sku: "ROR-00016",
|
115
|
+
cost_price: 15
|
116
|
+
},
|
117
|
+
apache_baseball_jersey => {
|
118
|
+
sku: "APC-00001",
|
119
|
+
cost_price: 17
|
120
|
+
},
|
121
|
+
ruby_baseball_jersey => {
|
122
|
+
sku: "RUB-00001",
|
123
|
+
cost_price: 17
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
Spree::Variant.create!(variants)
|
128
|
+
|
129
|
+
masters.each do |product, variant_attrs|
|
130
|
+
product.master.update_attributes!(variant_attrs)
|
131
|
+
end
|
data/db/samples.rb
ADDED
data/lib/spree/sample.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spree_core'
|
4
|
+
module Spree
|
5
|
+
module Sample
|
6
|
+
class << self
|
7
|
+
def load_sample(file)
|
8
|
+
# If file is exists within application it takes precendence.
|
9
|
+
if File.exist?(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
|
10
|
+
path = File.expand_path(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
|
11
|
+
else
|
12
|
+
# Otherwise we will use this gems default file.
|
13
|
+
path = File.expand_path(samples_path + "#{file}.rb")
|
14
|
+
end
|
15
|
+
# Check to see if the specified file has been loaded before
|
16
|
+
if !$LOADED_FEATURES.include?(path)
|
17
|
+
require path
|
18
|
+
puts "Loaded #{file.titleize} samples"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def samples_path
|
25
|
+
Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'db', 'samples'))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/spree_sample.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spree_core'
|
4
|
+
require 'spree/sample'
|
5
|
+
|
6
|
+
module SpreeSample
|
7
|
+
class Engine < Rails::Engine
|
8
|
+
engine_name 'spree_sample'
|
9
|
+
|
10
|
+
# Needs to be here so we can access it inside the tests
|
11
|
+
def self.load_samples
|
12
|
+
Spree::Sample.load_sample("payment_methods")
|
13
|
+
Spree::Sample.load_sample("tax_categories")
|
14
|
+
Spree::Sample.load_sample("tax_rates")
|
15
|
+
Spree::Sample.load_sample("shipping_categories")
|
16
|
+
Spree::Sample.load_sample("shipping_methods")
|
17
|
+
|
18
|
+
Spree::Sample.load_sample("products")
|
19
|
+
Spree::Sample.load_sample("taxons")
|
20
|
+
Spree::Sample.load_sample("option_values")
|
21
|
+
Spree::Sample.load_sample("product_option_types")
|
22
|
+
Spree::Sample.load_sample("product_properties")
|
23
|
+
Spree::Sample.load_sample("variants")
|
24
|
+
Spree::Sample.load_sample("stock")
|
25
|
+
Spree::Sample.load_sample("assets")
|
26
|
+
|
27
|
+
Spree::Sample.load_sample("orders")
|
28
|
+
Spree::Sample.load_sample("payments")
|
29
|
+
Spree::Sample.load_sample("reimbursements")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require 'spree/sample'
|
5
|
+
|
6
|
+
namespace :spree_sample do
|
7
|
+
desc 'Loads sample data'
|
8
|
+
task load: :environment do
|
9
|
+
if ARGV.include?("db:migrate")
|
10
|
+
puts %{
|
11
|
+
Please run db:migrate separately from spree_sample:load.
|
12
|
+
|
13
|
+
Running db:migrate and spree_sample:load at the same time has been known to
|
14
|
+
cause problems where columns may be not available during sample data loading.
|
15
|
+
|
16
|
+
Migrations have been run. Please run "rake spree_sample:load" by itself now.
|
17
|
+
}
|
18
|
+
exit(1)
|
19
|
+
end
|
20
|
+
|
21
|
+
SpreeSample::Engine.load_samples
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../core/lib/spree/core/version.rb'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.name = 'solidus_sample_devise_token_auth'
|
8
|
+
s.version = Spree.solidus_version
|
9
|
+
s.summary = 'Sample data (including images) for use with Solidus (devise_token_auth revised version)'
|
10
|
+
s.description = s.summary
|
11
|
+
|
12
|
+
s.author = 'Michał Siwek (skycocker)'
|
13
|
+
s.email = 'mike21@aol.pl'
|
14
|
+
s.homepage = 'https://github.com/skycocker/solidus/tree/master/sample'
|
15
|
+
s.license = 'BSD-3-Clause'
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.require_path = 'lib'
|
19
|
+
s.requirements << 'none'
|
20
|
+
|
21
|
+
s.required_ruby_version = '>= 2.2.2'
|
22
|
+
s.required_rubygems_version = '>= 1.8.23'
|
23
|
+
|
24
|
+
s.add_dependency 'solidus_core_devise_token_auth', s.version
|
25
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,41 @@
|
|
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
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: solidus_sample_devise_token_auth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.8.0.alpha.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michał Siwek (skycocker)
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: solidus_core_devise_token_auth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.8.0.alpha.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.8.0.alpha.3
|
27
|
+
description: Sample data (including images) for use with Solidus (devise_token_auth
|
28
|
+
revised version)
|
29
|
+
email: mike21@aol.pl
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- LICENSE
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- db/samples.rb
|
38
|
+
- db/samples/addresses.rb
|
39
|
+
- db/samples/assets.rb
|
40
|
+
- db/samples/images/apache_baseball.png
|
41
|
+
- db/samples/images/ror_bag.jpeg
|
42
|
+
- db/samples/images/ror_baseball.jpeg
|
43
|
+
- db/samples/images/ror_baseball_back.jpeg
|
44
|
+
- db/samples/images/ror_baseball_jersey_back_blue.png
|
45
|
+
- db/samples/images/ror_baseball_jersey_back_green.png
|
46
|
+
- db/samples/images/ror_baseball_jersey_back_red.png
|
47
|
+
- db/samples/images/ror_baseball_jersey_blue.png
|
48
|
+
- db/samples/images/ror_baseball_jersey_green.png
|
49
|
+
- db/samples/images/ror_baseball_jersey_red.png
|
50
|
+
- db/samples/images/ror_jr_spaghetti.jpeg
|
51
|
+
- db/samples/images/ror_mug.jpeg
|
52
|
+
- db/samples/images/ror_mug_back.jpeg
|
53
|
+
- db/samples/images/ror_ringer.jpeg
|
54
|
+
- db/samples/images/ror_ringer_back.jpeg
|
55
|
+
- db/samples/images/ror_stein.jpeg
|
56
|
+
- db/samples/images/ror_stein_back.jpeg
|
57
|
+
- db/samples/images/ror_tote.jpeg
|
58
|
+
- db/samples/images/ror_tote_back.jpeg
|
59
|
+
- db/samples/images/ruby_baseball.png
|
60
|
+
- db/samples/option_types.rb
|
61
|
+
- db/samples/option_values.rb
|
62
|
+
- db/samples/orders.rb
|
63
|
+
- db/samples/payment_methods.rb
|
64
|
+
- db/samples/payments.rb
|
65
|
+
- db/samples/product_option_types.rb
|
66
|
+
- db/samples/product_properties.rb
|
67
|
+
- db/samples/products.rb
|
68
|
+
- db/samples/reimbursements.rb
|
69
|
+
- db/samples/shipping_categories.rb
|
70
|
+
- db/samples/shipping_methods.rb
|
71
|
+
- db/samples/stock.rb
|
72
|
+
- db/samples/stores.rb
|
73
|
+
- db/samples/tax_categories.rb
|
74
|
+
- db/samples/tax_rates.rb
|
75
|
+
- db/samples/taxonomies.rb
|
76
|
+
- db/samples/taxons.rb
|
77
|
+
- db/samples/variants.rb
|
78
|
+
- lib/solidus_sample.rb
|
79
|
+
- lib/spree/sample.rb
|
80
|
+
- lib/spree_sample.rb
|
81
|
+
- lib/tasks/sample.rake
|
82
|
+
- solidus_sample.gemspec
|
83
|
+
- spec/lib/load_sample_spec.rb
|
84
|
+
- spec/spec_helper.rb
|
85
|
+
homepage: https://github.com/skycocker/solidus/tree/master/sample
|
86
|
+
licenses:
|
87
|
+
- BSD-3-Clause
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 2.2.2
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.8.23
|
103
|
+
requirements:
|
104
|
+
- none
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.7.6
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: Sample data (including images) for use with Solidus (devise_token_auth revised
|
110
|
+
version)
|
111
|
+
test_files: []
|