noths 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +10 -23
- data/bin/generate_gem +3 -1
- data/bin/refresh_schemas +22 -16
- data/docs/AcceptanceBulkModel.md +2 -2
- data/docs/DispatchBulkModel.md +1 -1
- data/docs/Financials.md +1 -1
- data/docs/Order.md +12 -11
- data/docs/OrdersApi.md +104 -151
- data/docs/RefundsApi.md +8 -12
- data/git_push.sh +55 -0
- data/lib/noths.rb +1 -11
- data/lib/noths/api/orders_api.rb +234 -114
- data/lib/noths/api/refunds_api.rb +25 -15
- data/lib/noths/api_client.rb +3 -12
- data/lib/noths/api_error.rb +16 -11
- data/lib/noths/configuration.rb +3 -20
- data/lib/noths/models/acceptance_bulk_model.rb +3 -14
- data/lib/noths/models/currency.rb +1 -12
- data/lib/noths/models/decline_bulk_model.rb +1 -12
- data/lib/noths/models/delivery_address.rb +1 -12
- data/lib/noths/models/delivery_service.rb +1 -12
- data/lib/noths/models/delivery_zone.rb +1 -12
- data/lib/noths/models/dispatch_bulk_model.rb +2 -13
- data/lib/noths/models/dispatch_notes_bulk_model.rb +1 -12
- data/lib/noths/models/enquiry.rb +1 -12
- data/lib/noths/models/enquiry_message.rb +1 -12
- data/lib/noths/models/error.rb +1 -12
- data/lib/noths/models/financials.rb +5 -14
- data/lib/noths/models/financials_details.rb +1 -12
- data/lib/noths/models/image_url.rb +1 -12
- data/lib/noths/models/item.rb +1 -12
- data/lib/noths/models/item_financials.rb +1 -12
- data/lib/noths/models/link.rb +1 -12
- data/lib/noths/models/manual_payment.rb +1 -12
- data/lib/noths/models/money.rb +1 -12
- data/lib/noths/models/order.rb +28 -28
- data/lib/noths/models/order_detail.rb +1 -12
- data/lib/noths/models/order_details_bulk_model.rb +1 -12
- data/lib/noths/models/order_index.rb +1 -12
- data/lib/noths/models/order_refund.rb +1 -12
- data/lib/noths/models/product.rb +1 -12
- data/lib/noths/models/product_option.rb +1 -12
- data/lib/noths/models/refund_response.rb +1 -12
- data/lib/noths/models/search_result_meta.rb +1 -12
- data/lib/noths/models/user.rb +1 -12
- data/lib/noths/version.rb +2 -12
- data/noths.gemspec +1 -11
- data/schemas/api-docs.json +3 -7
- data/schemas/orders.json +163 -88
- data/schemas/refunds.json +10 -5
- data/spec/api/orders_api_spec.rb +53 -99
- data/spec/api/refunds_api_spec.rb +6 -28
- data/spec/api_client_spec.rb +2 -14
- data/spec/configuration_spec.rb +9 -25
- data/spec/models/acceptance_bulk_model_spec.rb +7 -38
- data/spec/models/currency_spec.rb +7 -38
- data/spec/models/decline_bulk_model_spec.rb +5 -32
- data/spec/models/delivery_address_spec.rb +9 -44
- data/spec/models/delivery_service_spec.rb +5 -32
- data/spec/models/delivery_zone_spec.rb +5 -32
- data/spec/models/dispatch_bulk_model_spec.rb +8 -41
- data/spec/models/dispatch_notes_bulk_model_spec.rb +4 -29
- data/spec/models/enquiry_message_spec.rb +4 -29
- data/spec/models/enquiry_spec.rb +6 -35
- data/spec/models/error_spec.rb +5 -32
- data/spec/models/financials_details_spec.rb +6 -35
- data/spec/models/financials_spec.rb +21 -80
- data/spec/models/image_url_spec.rb +9 -44
- data/spec/models/item_financials_spec.rb +9 -44
- data/spec/models/item_spec.rb +11 -50
- data/spec/models/link_spec.rb +6 -35
- data/spec/models/manual_payment_spec.rb +7 -38
- data/spec/models/money_spec.rb +5 -32
- data/spec/models/order_detail_spec.rb +5 -32
- data/spec/models/order_details_bulk_model_spec.rb +4 -29
- data/spec/models/order_index_spec.rb +6 -35
- data/spec/models/order_refund_spec.rb +4 -29
- data/spec/models/order_spec.rb +53 -164
- data/spec/models/product_option_spec.rb +5 -32
- data/spec/models/product_spec.rb +8 -41
- data/spec/models/refund_response_spec.rb +6 -35
- data/spec/models/search_result_meta_spec.rb +5 -32
- data/spec/models/user_spec.rb +6 -35
- data/spec/spec_helper.rb +1 -11
- data/swagger_config.json +1 -1
- data/templates/Gemfile.mustache +7 -0
- data/templates/README.mustache +127 -0
- data/templates/Rakefile.mustache +8 -0
- data/templates/api.mustache +194 -0
- data/templates/api_client.mustache +383 -0
- data/templates/api_client_spec.mustache +214 -0
- data/templates/api_doc.mustache +79 -0
- data/templates/api_error.mustache +43 -0
- data/templates/api_info.mustache +12 -0
- data/templates/api_test.mustache +29 -0
- data/templates/base_object.mustache +102 -0
- data/templates/base_object_spec.mustache +107 -0
- data/templates/configuration.mustache +221 -0
- data/templates/configuration_spec.mustache +26 -0
- data/templates/gem.mustache +38 -0
- data/templates/gemspec.mustache +41 -0
- data/templates/git_push.sh.mustache +55 -0
- data/templates/gitignore.mustache +35 -0
- data/templates/model.mustache +7 -0
- data/templates/model_doc.mustache +9 -0
- data/templates/model_test.mustache +19 -0
- data/templates/partial_model_enum_class.mustache +13 -0
- data/templates/partial_model_generic.mustache +275 -0
- data/templates/rspec.mustache +2 -0
- data/templates/spec_helper.mustache +101 -0
- data/templates/version.mustache +5 -0
- metadata +30 -3
data/schemas/refunds.json
CHANGED
@@ -9,6 +9,13 @@
|
|
9
9
|
"operations": [
|
10
10
|
{
|
11
11
|
"parameters": [
|
12
|
+
{
|
13
|
+
"paramType": "query",
|
14
|
+
"name": "token",
|
15
|
+
"type": "string",
|
16
|
+
"description": "Authentication credential",
|
17
|
+
"required": true
|
18
|
+
},
|
12
19
|
{
|
13
20
|
"paramType": "path",
|
14
21
|
"name": "order_id",
|
@@ -57,11 +64,9 @@
|
|
57
64
|
],
|
58
65
|
"method": "post",
|
59
66
|
"nickname": "Refunds#create",
|
60
|
-
"
|
61
|
-
"
|
62
|
-
|
63
|
-
]
|
64
|
-
}
|
67
|
+
"consumes": [
|
68
|
+
"application/x-www-form-urlencoded"
|
69
|
+
]
|
65
70
|
}
|
66
71
|
]
|
67
72
|
}
|
data/spec/api/orders_api_spec.rb
CHANGED
@@ -1,38 +1,18 @@
|
|
1
|
-
|
2
|
-
#Noths
|
3
|
-
|
4
|
-
#www.notonthehighstreet.com API client
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
1
|
+
# frozen_string_literal: true
|
15
2
|
|
16
3
|
# Unit tests for Noths::OrdersApi
|
17
4
|
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
5
|
# Please update as you see appropriate
|
19
6
|
describe 'OrdersApi' do
|
20
|
-
|
21
|
-
# run before each test
|
22
|
-
@instance = Noths::OrdersApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
7
|
+
let(:instance) { Noths::OrdersApi.new }
|
28
8
|
|
29
9
|
describe 'test an instance of OrdersApi' do
|
30
10
|
it 'should create an instance of OrdersApi' do
|
31
|
-
expect(
|
11
|
+
expect(instance).to be_instance_of(Noths::OrdersApi)
|
32
12
|
end
|
33
13
|
end
|
34
14
|
|
35
|
-
# unit tests for
|
15
|
+
# unit tests for orders_acceptance
|
36
16
|
# Accept an order
|
37
17
|
# Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
|
38
18
|
# @param token Authentication credential
|
@@ -42,26 +22,22 @@ describe 'OrdersApi' do
|
|
42
22
|
# @param [Hash] opts the optional parameters
|
43
23
|
# @option opts [String] :confirmation_note
|
44
24
|
# @return [nil]
|
45
|
-
describe '
|
46
|
-
it
|
47
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
48
|
-
end
|
25
|
+
describe 'orders_acceptance test' do
|
26
|
+
it 'should work'
|
49
27
|
end
|
50
28
|
|
51
|
-
# unit tests for
|
29
|
+
# unit tests for orders_acceptance_bulk
|
52
30
|
# Accept multiple orders
|
53
31
|
# Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
|
54
32
|
# @param token Authentication credential
|
55
|
-
# @param
|
33
|
+
# @param payload
|
56
34
|
# @param [Hash] opts the optional parameters
|
57
35
|
# @return [nil]
|
58
|
-
describe '
|
59
|
-
it
|
60
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
61
|
-
end
|
36
|
+
describe 'orders_acceptance_bulk test' do
|
37
|
+
it 'should work'
|
62
38
|
end
|
63
39
|
|
64
|
-
# unit tests for
|
40
|
+
# unit tests for orders_decline
|
65
41
|
# Decline an order
|
66
42
|
# Declines an order that is in the placed state
|
67
43
|
# @param token Authentication credential
|
@@ -69,53 +45,45 @@ describe 'OrdersApi' do
|
|
69
45
|
# @param decline_reason
|
70
46
|
# @param [Hash] opts the optional parameters
|
71
47
|
# @return [nil]
|
72
|
-
describe '
|
73
|
-
it
|
74
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
75
|
-
end
|
48
|
+
describe 'orders_decline test' do
|
49
|
+
it 'should work'
|
76
50
|
end
|
77
51
|
|
78
|
-
# unit tests for
|
52
|
+
# unit tests for orders_decline_bulk
|
79
53
|
# Decline multiple orders
|
80
54
|
# Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
|
81
55
|
# @param token Authentication credential
|
82
|
-
# @param
|
56
|
+
# @param payload
|
83
57
|
# @param [Hash] opts the optional parameters
|
84
58
|
# @return [nil]
|
85
|
-
describe '
|
86
|
-
it
|
87
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
88
|
-
end
|
59
|
+
describe 'orders_decline_bulk test' do
|
60
|
+
it 'should work'
|
89
61
|
end
|
90
62
|
|
91
|
-
# unit tests for
|
63
|
+
# unit tests for orders_dispatch_note
|
92
64
|
# Generate a dispatch note pdf or gift note pdf.
|
93
65
|
# Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.<p/>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
|
94
66
|
# @param token Authentication credential
|
95
67
|
# @param id Order id
|
96
68
|
# @param [Hash] opts the optional parameters
|
97
69
|
# @option opts [String] :force_type Type of document
|
98
|
-
# @return [
|
99
|
-
describe '
|
100
|
-
it
|
101
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
102
|
-
end
|
70
|
+
# @return [File]
|
71
|
+
describe 'orders_dispatch_note test' do
|
72
|
+
it 'should work'
|
103
73
|
end
|
104
74
|
|
105
|
-
# unit tests for
|
75
|
+
# unit tests for orders_dispatch_notes_bulk
|
106
76
|
# Generate pdf with dispatch note for each order
|
107
77
|
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
108
78
|
# @param token Authentication credential
|
109
|
-
# @param
|
79
|
+
# @param payload
|
110
80
|
# @param [Hash] opts the optional parameters
|
111
|
-
# @return [
|
112
|
-
describe '
|
113
|
-
it
|
114
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
-
end
|
81
|
+
# @return [File]
|
82
|
+
describe 'orders_dispatch_notes_bulk test' do
|
83
|
+
it 'should work'
|
116
84
|
end
|
117
85
|
|
118
|
-
# unit tests for
|
86
|
+
# unit tests for orders_dispatch_order
|
119
87
|
# Dispatch an order
|
120
88
|
# Dispatches an order that is in an accepted state and has also had its dispatch note printed
|
121
89
|
# @param token Authentication credential
|
@@ -127,27 +95,23 @@ describe 'OrdersApi' do
|
|
127
95
|
# @option opts [String] :parcel_tracking_url
|
128
96
|
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
129
97
|
# @return [nil]
|
130
|
-
describe '
|
131
|
-
it
|
132
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
133
|
-
end
|
98
|
+
describe 'orders_dispatch_order test' do
|
99
|
+
it 'should work'
|
134
100
|
end
|
135
101
|
|
136
|
-
# unit tests for
|
102
|
+
# unit tests for orders_dispatch_orders_bulk
|
137
103
|
# Dispatch multiple orders
|
138
104
|
# Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
|
139
105
|
# @param token Authentication credential
|
140
|
-
# @param
|
106
|
+
# @param payload
|
141
107
|
# @param [Hash] opts the optional parameters
|
142
108
|
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
143
109
|
# @return [nil]
|
144
|
-
describe '
|
145
|
-
it
|
146
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
147
|
-
end
|
110
|
+
describe 'orders_dispatch_orders_bulk test' do
|
111
|
+
it 'should work'
|
148
112
|
end
|
149
113
|
|
150
|
-
# unit tests for
|
114
|
+
# unit tests for orders_index
|
151
115
|
# Fetch orders
|
152
116
|
# Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
|
153
117
|
# @param token Authentication credential
|
@@ -174,55 +138,47 @@ describe 'OrdersApi' do
|
|
174
138
|
# @option opts [String] :query Matches your query to information related to your orders
|
175
139
|
# @option opts [BOOLEAN] :repeat_customer
|
176
140
|
# @option opts [String] :sort Defaults to placed_at
|
177
|
-
# @option opts [String] :state State
|
141
|
+
# @option opts [Array<String>] :state State
|
178
142
|
# @return [OrderIndex]
|
179
|
-
describe '
|
180
|
-
it
|
181
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
182
|
-
end
|
143
|
+
describe 'orders_index test' do
|
144
|
+
it 'should work'
|
183
145
|
end
|
184
146
|
|
185
|
-
# unit tests for
|
147
|
+
# unit tests for orders_invoice
|
186
148
|
# Generate a vat invoice pdf.
|
187
149
|
# <p>Invoices are currently only applicable for the UK site</p>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
|
188
150
|
# @param token Authentication credential
|
189
151
|
# @param id Order id
|
190
152
|
# @param type Type of invoice
|
191
153
|
# @param [Hash] opts the optional parameters
|
192
|
-
# @return [
|
193
|
-
describe '
|
194
|
-
it
|
195
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
196
|
-
end
|
154
|
+
# @return [File]
|
155
|
+
describe 'orders_invoice test' do
|
156
|
+
it 'should work'
|
197
157
|
end
|
198
158
|
|
199
|
-
# unit tests for
|
159
|
+
# unit tests for orders_order_details
|
200
160
|
# Generate an order details pdf
|
201
161
|
# Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
|
202
162
|
# @param token Authentication credential
|
203
163
|
# @param id Order id
|
204
164
|
# @param [Hash] opts the optional parameters
|
205
|
-
# @return [
|
206
|
-
describe '
|
207
|
-
it
|
208
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
209
|
-
end
|
165
|
+
# @return [File]
|
166
|
+
describe 'orders_order_details test' do
|
167
|
+
it 'should work'
|
210
168
|
end
|
211
169
|
|
212
|
-
# unit tests for
|
170
|
+
# unit tests for orders_order_details_bulk
|
213
171
|
# Generate pdf with order details for each order
|
214
172
|
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
215
173
|
# @param token Authentication credential
|
216
|
-
# @param
|
174
|
+
# @param payload
|
217
175
|
# @param [Hash] opts the optional parameters
|
218
|
-
# @return [
|
219
|
-
describe '
|
220
|
-
it
|
221
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
222
|
-
end
|
176
|
+
# @return [File]
|
177
|
+
describe 'orders_order_details_bulk test' do
|
178
|
+
it 'should work'
|
223
179
|
end
|
224
180
|
|
225
|
-
# unit tests for
|
181
|
+
# unit tests for orders_show
|
226
182
|
# Fetch a single Order
|
227
183
|
#
|
228
184
|
# @param token Authentication credential
|
@@ -230,10 +186,8 @@ describe 'OrdersApi' do
|
|
230
186
|
# @param [Hash] opts the optional parameters
|
231
187
|
# @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: <br /><b style=\"margin-left: 10px\">financials</b> <p style=\"margin-left: 20px\"> Additional financial data about this order, eg: commission and discount amounts. </p>
|
232
188
|
# @return [Order]
|
233
|
-
describe '
|
234
|
-
it
|
235
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
236
|
-
end
|
189
|
+
describe 'orders_show test' do
|
190
|
+
it 'should work'
|
237
191
|
end
|
238
192
|
|
239
193
|
end
|
@@ -1,38 +1,18 @@
|
|
1
|
-
|
2
|
-
#Noths
|
3
|
-
|
4
|
-
#www.notonthehighstreet.com API client
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
1
|
+
# frozen_string_literal: true
|
15
2
|
|
16
3
|
# Unit tests for Noths::RefundsApi
|
17
4
|
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
5
|
# Please update as you see appropriate
|
19
6
|
describe 'RefundsApi' do
|
20
|
-
|
21
|
-
# run before each test
|
22
|
-
@instance = Noths::RefundsApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
7
|
+
let(:instance) { Noths::RefundsApi.new }
|
28
8
|
|
29
9
|
describe 'test an instance of RefundsApi' do
|
30
10
|
it 'should create an instance of RefundsApi' do
|
31
|
-
expect(
|
11
|
+
expect(instance).to be_instance_of(Noths::RefundsApi)
|
32
12
|
end
|
33
13
|
end
|
34
14
|
|
35
|
-
# unit tests for
|
15
|
+
# unit tests for refunds_create
|
36
16
|
# Refund an order
|
37
17
|
# Refunds all or part of an order
|
38
18
|
# @param token Authentication credential
|
@@ -41,10 +21,8 @@ describe 'RefundsApi' do
|
|
41
21
|
# @param cents
|
42
22
|
# @param [Hash] opts the optional parameters
|
43
23
|
# @return [RefundResponse]
|
44
|
-
describe '
|
45
|
-
it
|
46
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
-
end
|
24
|
+
describe 'refunds_create test' do
|
25
|
+
it 'should work'
|
48
26
|
end
|
49
27
|
|
50
28
|
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -1,16 +1,4 @@
|
|
1
|
-
|
2
|
-
#Noths
|
3
|
-
|
4
|
-
#www.notonthehighstreet.com API client
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
1
|
+
# frozen_string_literal: true
|
14
2
|
|
15
3
|
describe Noths::ApiClient do
|
16
4
|
context 'initialization' do
|
@@ -124,7 +112,7 @@ describe Noths::ApiClient do
|
|
124
112
|
#api_client = Noths::ApiClient.new
|
125
113
|
#_model = Noths::ModelName.new
|
126
114
|
# update the model attribute below
|
127
|
-
#_model.id = 1
|
115
|
+
#_model.id = 1
|
128
116
|
# update the expected value (hash) below
|
129
117
|
#expected = {id: 1, name: '', tags: []}
|
130
118
|
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
data/spec/configuration_spec.rb
CHANGED
@@ -1,41 +1,25 @@
|
|
1
|
-
|
2
|
-
#Noths
|
3
|
-
|
4
|
-
#www.notonthehighstreet.com API client
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
1
|
+
# frozen_string_literal: true
|
14
2
|
|
15
3
|
describe Noths::Configuration do
|
16
4
|
let(:config) { Noths::Configuration.default }
|
17
5
|
|
18
|
-
before
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# c.base_path = uri.path
|
25
|
-
#end
|
6
|
+
before do
|
7
|
+
Noths.configure do |c|
|
8
|
+
c.scheme = 'https'
|
9
|
+
c.host = 'api.example.com'
|
10
|
+
c.base_path = '/v1'
|
11
|
+
end
|
26
12
|
end
|
27
13
|
|
28
14
|
describe '#base_url' do
|
29
15
|
it 'should have the default value' do
|
30
|
-
|
31
|
-
#expect(config.base_url).to eq("http://localhost")
|
16
|
+
expect(config.base_url).to eq("https://api.example.com/v1")
|
32
17
|
end
|
33
18
|
|
34
19
|
it 'should remove trailing slashes' do
|
35
20
|
[nil, '', '/', '//'].each do |base_path|
|
36
21
|
config.base_path = base_path
|
37
|
-
|
38
|
-
#expect(config.base_url).to eq("http://localhost")
|
22
|
+
expect(config.base_url).to eq("https://api.example.com")
|
39
23
|
end
|
40
24
|
end
|
41
25
|
end
|
@@ -1,59 +1,28 @@
|
|
1
|
-
|
2
|
-
#Noths
|
3
|
-
|
4
|
-
#www.notonthehighstreet.com API client
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
1
|
+
# frozen_string_literal: true
|
16
2
|
|
17
3
|
# Unit tests for Noths::AcceptanceBulkModel
|
18
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
-
# Please update as you see appropriate
|
20
4
|
describe 'AcceptanceBulkModel' do
|
21
|
-
|
22
|
-
# run before each test
|
23
|
-
@instance = Noths::AcceptanceBulkModel.new
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
# run after each test
|
28
|
-
end
|
5
|
+
let(:instance) { Noths::AcceptanceBulkModel.new }
|
29
6
|
|
30
7
|
describe 'test an instance of AcceptanceBulkModel' do
|
31
8
|
it 'should create an instance of AcceptanceBulkModel' do
|
32
|
-
expect(
|
9
|
+
expect(instance).to be_instance_of(Noths::AcceptanceBulkModel)
|
33
10
|
end
|
34
11
|
end
|
35
12
|
describe 'test attribute "id"' do
|
36
|
-
it 'should work'
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
13
|
+
it 'should work'
|
39
14
|
end
|
40
15
|
|
41
16
|
describe 'test attribute "estimated_delivery_date"' do
|
42
|
-
it 'should work'
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
17
|
+
it 'should work'
|
45
18
|
end
|
46
19
|
|
47
20
|
describe 'test attribute "estimated_dispatch_at"' do
|
48
|
-
it 'should work'
|
49
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
-
end
|
21
|
+
it 'should work'
|
51
22
|
end
|
52
23
|
|
53
24
|
describe 'test attribute "confirmation_note"' do
|
54
|
-
it 'should work'
|
55
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
-
end
|
25
|
+
it 'should work'
|
57
26
|
end
|
58
27
|
|
59
28
|
end
|