workarea-api 4.5.3 → 4.5.4
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 +4 -4
- data/CHANGELOG.md +24 -0
- data/Rakefile +2 -0
- data/admin/app/controllers/workarea/api/admin/recommendation_settings_controller.rb +1 -1
- data/admin/test/integration/workarea/api/admin/recommendation_settings_integration_test.rb +14 -0
- data/lib/workarea/api/version.rb +1 -1
- data/storefront/test/documentation/workarea/api/storefront/checkouts_documentation_test.rb +21 -0
- data/storefront/test/documentation/workarea/api/storefront/validation_documentation_test.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb882700d49c189d82c8986183a1cba9750f01187f172fcc81988d27e2236ab1
|
4
|
+
data.tar.gz: 7de993c7945ed5934c9c3bdd9d1bb50d278876c915c5d46c01686100e520d1cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 103ac8773fa6881af720616002bc3e1ff8bfbbb98d232de9527f4e2755de9299775254a6bedbd8201393812977dd7d9854c59120ca5ee2e277be4f158d3b3939
|
7
|
+
data.tar.gz: a9907fd80fa4797e28a6cfc460a5720fdf809510bb0dc8cfb8c4d97f974389d1a3900ee1ae11e6890f3afe8321d84f09547761fb0c4acff914226b12e77cb78e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
Workarea Api 4.5.4 (2020-08-19)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Handle non-persisted recommendation settings
|
5
|
+
|
6
|
+
This uses `find_or_initialize` to match our usage of
|
7
|
+
`Recommendation::Settings` elsewhere in the platform.
|
8
|
+
|
9
|
+
Fixes #19
|
10
|
+
Ben Crouse
|
11
|
+
|
12
|
+
* Add Documentation Test for Failed Checkout Update
|
13
|
+
|
14
|
+
This documents the scenario in which a checkout update fails to persist,
|
15
|
+
and thus the API returns a `422` error to signify its failure. It
|
16
|
+
depends on the code changes in workarea-commerce/workarea#481, and thus
|
17
|
+
we will need to bump the Workarea version to restrict its upgrade to
|
18
|
+
users of v3.5.17 and beyond.
|
19
|
+
|
20
|
+
API-14
|
21
|
+
Tom Scott
|
22
|
+
|
23
|
+
|
24
|
+
|
1
25
|
Workarea Api 4.5.3 (2020-03-26)
|
2
26
|
--------------------------------------------------------------------------------
|
3
27
|
|
data/Rakefile
CHANGED
@@ -114,7 +114,7 @@ module Workarea
|
|
114
114
|
private
|
115
115
|
|
116
116
|
def find_recommendation_settings
|
117
|
-
@recommendation_settings = Recommendation::Settings.
|
117
|
+
@recommendation_settings = Recommendation::Settings.find_or_initialize_by(id: params[:product_id])
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -35,6 +35,20 @@ module Workarea
|
|
35
35
|
|
36
36
|
assert_equal(['foo'], recommendation_settings.reload.product_ids)
|
37
37
|
end
|
38
|
+
|
39
|
+
def test_unpersisted_recommendation_settings
|
40
|
+
get admin_api.product_recommendation_settings_path(@product.id)
|
41
|
+
result = JSON.parse(response.body)['recommendation_settings']
|
42
|
+
assert_equal(@product.id, result['_id'])
|
43
|
+
assert_equal(0, Recommendation::Settings.count)
|
44
|
+
|
45
|
+
patch admin_api.product_recommendation_settings_path(@product.id),
|
46
|
+
params: { recommendation_settings: { product_ids: ['foo'] } }
|
47
|
+
|
48
|
+
assert_equal(1, Recommendation::Settings.count)
|
49
|
+
assert_equal(@product.id, Recommendation::Settings.first.id)
|
50
|
+
assert_equal(['foo'], Recommendation::Settings.first.product_ids)
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
end
|
data/lib/workarea/api/version.rb
CHANGED
@@ -85,6 +85,27 @@ module Workarea
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
def test_and_document_update_failure
|
89
|
+
description 'Failure to update a checkout'
|
90
|
+
route storefront_api.checkout_path(':id')
|
91
|
+
explanation <<-EOS
|
92
|
+
This is an example of what occurs when you fail to send in the correct parameters for your checkout.
|
93
|
+
EOS
|
94
|
+
|
95
|
+
record_request do
|
96
|
+
patch storefront_api.checkout_path(@order),
|
97
|
+
as: :json,
|
98
|
+
params: {
|
99
|
+
email: 'susanb@workarea.com',
|
100
|
+
shipping_address: address.except(:first_name),
|
101
|
+
billing_address: address.except(:last_name),
|
102
|
+
shipping_service: 'Express'
|
103
|
+
}
|
104
|
+
|
105
|
+
assert_equal(422, response.status)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
88
109
|
def test_and_document_complete
|
89
110
|
description 'Completing a checkout'
|
90
111
|
route storefront_api.complete_checkout_path(':id')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: workarea
|
@@ -37,28 +37,28 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.5.
|
40
|
+
version: 4.5.4
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.5.
|
47
|
+
version: 4.5.4
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: workarea-api-admin
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.5.
|
54
|
+
version: 4.5.4
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.5.
|
61
|
+
version: 4.5.4
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: raddocs
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -755,7 +755,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
755
755
|
- !ruby/object:Gem::Version
|
756
756
|
version: '0'
|
757
757
|
requirements: []
|
758
|
-
rubygems_version: 3.0.
|
758
|
+
rubygems_version: 3.0.3
|
759
759
|
signing_key:
|
760
760
|
specification_version: 4
|
761
761
|
summary: Adds a JSON REST API to the Workarea Commerce Platform
|