workarea-core 3.4.37 → 3.4.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/mailers/workarea/application_mailer.rb +4 -1
- data/app/models/workarea/checkout.rb +6 -2
- data/app/models/workarea/inquiry.rb +2 -1
- data/config/locales/en.yml +2 -0
- data/lib/generators/workarea/install/install_generator.rb +13 -0
- data/lib/generators/workarea/install/templates/initializer.rb.erb +1 -1
- data/lib/workarea/version.rb +1 -1
- data/test/generators/workarea/install_generator_test.rb +6 -0
- data/test/mailers/workarea/application_mailer_test.rb +10 -0
- data/test/models/workarea/checkout_test.rb +57 -0
- data/workarea-core.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ffbb2028cd43e91abbc3601126483073b55997738eba74759b902e353590b67
|
4
|
+
data.tar.gz: 70acccdddb99146faaf878e862bc8a1e2161f5c2a62a10cd0f3f1f5f97bc4b19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb66b15c9317d085e8dbd97262ddf4ae85ef31eb5cbb77b1bf6375f69b284a6ce439579c534b6ec05c337644b022e4b186e4f55c51cabf555a29c490f131bc8e
|
7
|
+
data.tar.gz: db47bf0b35f4f7f12a27b05759d242301e7b0b6779670d41fab803129fd391c9246ecc08f494314e3865c5f8190a636d6f1df521b3b31d545dec53c624c5a6dd
|
@@ -7,7 +7,10 @@ module Workarea
|
|
7
7
|
default from: -> (*) { Workarea.config.email_from }
|
8
8
|
|
9
9
|
def default_url_options(options = {})
|
10
|
-
super
|
10
|
+
# super isn't returning the configured options, so manually merge them in
|
11
|
+
super
|
12
|
+
.merge(Rails.application.config.action_mailer.default_url_options.to_h)
|
13
|
+
.merge(host: Workarea.config.host)
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
@@ -158,10 +158,14 @@ module Workarea
|
|
158
158
|
# Used in auto completing an order for a logged in user.
|
159
159
|
#
|
160
160
|
# @param [Hash] parameters for updating
|
161
|
-
# @return [
|
161
|
+
# @return [Boolean] whether the update was successful.
|
162
162
|
#
|
163
163
|
def update(params = {})
|
164
|
-
|
164
|
+
return true if params.blank?
|
165
|
+
|
166
|
+
steps.reduce(true) do |result, step|
|
167
|
+
result &= step.new(self).update(params)
|
168
|
+
end
|
165
169
|
end
|
166
170
|
|
167
171
|
# Whether this checkout needs any further information
|
data/config/locales/en.yml
CHANGED
@@ -63,6 +63,19 @@ module Workarea
|
|
63
63
|
remove_file 'public/favicon.ico'
|
64
64
|
end
|
65
65
|
|
66
|
+
def add_development_mailer_port
|
67
|
+
development_port = <<-CODE
|
68
|
+
|
69
|
+
config.action_mailer.default_url_options = { port: 3000 }
|
70
|
+
CODE
|
71
|
+
|
72
|
+
inject_into_file(
|
73
|
+
'config/environments/development.rb',
|
74
|
+
development_port,
|
75
|
+
before: /^end/
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
66
79
|
private
|
67
80
|
|
68
81
|
def app_name
|
data/lib/workarea/version.rb
CHANGED
@@ -88,5 +88,11 @@ module Workarea
|
|
88
88
|
def test_favicon
|
89
89
|
assert_no_file 'public/favicon.ico'
|
90
90
|
end
|
91
|
+
|
92
|
+
def test_development_mailer_port
|
93
|
+
assert_file 'config/environments/development.rb' do |file|
|
94
|
+
assert_match(%(config.action_mailer.default_url_options = { port: 3000 }), file)
|
95
|
+
end
|
96
|
+
end
|
91
97
|
end
|
92
98
|
end
|
@@ -21,5 +21,15 @@ module Workarea
|
|
21
21
|
assert_equal([changed_email], changed_mail.from)
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
def test_default_url_options
|
26
|
+
@current_options = Rails.application.config.action_mailer.default_url_options.deep_dup
|
27
|
+
Rails.application.config.action_mailer.default_url_options = { port: 12345 }
|
28
|
+
|
29
|
+
assert_equal(12345, ApplicationMailer.new.default_url_options[:port])
|
30
|
+
|
31
|
+
ensure
|
32
|
+
Rails.application.config.action_mailer.default_url_options = @current_options
|
33
|
+
end
|
24
34
|
end
|
25
35
|
end
|
@@ -51,6 +51,63 @@ module Workarea
|
|
51
51
|
refute_equal(payment_id, checkout.payment.object_id)
|
52
52
|
end
|
53
53
|
|
54
|
+
def test_update
|
55
|
+
create_shipping_service
|
56
|
+
checkout = Checkout.new(@order)
|
57
|
+
|
58
|
+
checkout.start_as(:guest)
|
59
|
+
|
60
|
+
refute(
|
61
|
+
checkout.update(
|
62
|
+
email: 'test@workarea.com',
|
63
|
+
shipping_address: {
|
64
|
+
last_name: 'Crouse',
|
65
|
+
street: '22 S. 3rd St.',
|
66
|
+
street_2: 'Second Floor',
|
67
|
+
city: 'Philadelphia',
|
68
|
+
region: 'PA',
|
69
|
+
postal_code: '19106',
|
70
|
+
country: 'US'
|
71
|
+
},
|
72
|
+
billing_address: {
|
73
|
+
first_name: 'Ben',
|
74
|
+
street: '22 S. 3rd St.',
|
75
|
+
street_2: 'Second Floor',
|
76
|
+
city: 'Philadelphia',
|
77
|
+
region: 'PA',
|
78
|
+
postal_code: '19106',
|
79
|
+
country: 'US'
|
80
|
+
}
|
81
|
+
)
|
82
|
+
)
|
83
|
+
|
84
|
+
assert(
|
85
|
+
checkout.update(
|
86
|
+
email: 'test@workarea.com',
|
87
|
+
shipping_address: {
|
88
|
+
first_name: 'Ben',
|
89
|
+
last_name: 'Crouse',
|
90
|
+
street: '22 S. 3rd St.',
|
91
|
+
street_2: 'Second Floor',
|
92
|
+
city: 'Philadelphia',
|
93
|
+
region: 'PA',
|
94
|
+
postal_code: '19106',
|
95
|
+
country: 'US'
|
96
|
+
},
|
97
|
+
billing_address: {
|
98
|
+
first_name: 'Ben',
|
99
|
+
last_name: 'Crouse',
|
100
|
+
street: '22 S. 3rd St.',
|
101
|
+
street_2: 'Second Floor',
|
102
|
+
city: 'Philadelphia',
|
103
|
+
region: 'PA',
|
104
|
+
postal_code: '19106',
|
105
|
+
country: 'US'
|
106
|
+
}
|
107
|
+
)
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
54
111
|
def test_continue_as
|
55
112
|
checkout = Checkout.new(@order)
|
56
113
|
checkout.continue_as(@user)
|
data/workarea-core.gemspec
CHANGED
@@ -90,7 +90,7 @@ Gem::Specification.new do |s|
|
|
90
90
|
s.add_dependency 'referer-parser', '~> 0.3.0'
|
91
91
|
s.add_dependency 'serviceworker-rails', '~> 0.5.5'
|
92
92
|
s.add_dependency 'logstasher', '~> 1.2.2'
|
93
|
-
s.add_dependency 'chartkick', '~> 3.
|
93
|
+
s.add_dependency 'chartkick', '~> 3.4.0'
|
94
94
|
s.add_dependency 'puma', '>= 4.3.1'
|
95
95
|
s.add_dependency 'rack' , '>= 2.1.4'
|
96
96
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -1086,14 +1086,14 @@ dependencies:
|
|
1086
1086
|
requirements:
|
1087
1087
|
- - "~>"
|
1088
1088
|
- !ruby/object:Gem::Version
|
1089
|
-
version: 3.
|
1089
|
+
version: 3.4.0
|
1090
1090
|
type: :runtime
|
1091
1091
|
prerelease: false
|
1092
1092
|
version_requirements: !ruby/object:Gem::Requirement
|
1093
1093
|
requirements:
|
1094
1094
|
- - "~>"
|
1095
1095
|
- !ruby/object:Gem::Version
|
1096
|
-
version: 3.
|
1096
|
+
version: 3.4.0
|
1097
1097
|
- !ruby/object:Gem::Dependency
|
1098
1098
|
name: puma
|
1099
1099
|
requirement: !ruby/object:Gem::Requirement
|